Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clerk/client/rest :: add : blocktime check in recordListHandlerFn #993

Merged
merged 1 commit into from
May 25, 2023

Conversation

0xsharma
Copy link
Contributor

@0xsharma 0xsharma commented May 25, 2023

Description

Handle heimdalld not in sync when bor is querying latest state-syncs for syncing blocks. In request we send 'to-time' timestamp. We return nothing if to-time > heimdall_latest_block_timestamp

@codecov
Copy link

codecov bot commented May 25, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (3bddacf) 75.41% compared to head (7f96c04) 75.41%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #993   +/-   ##
========================================
  Coverage    75.41%   75.41%           
========================================
  Files           49       49           
  Lines         5296     5296           
========================================
  Hits          3994     3994           
  Misses        1068     1068           
  Partials       234      234           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@0xsharma 0xsharma changed the title add : blocktime check in recordListHandlerFn clerk/client/rest :: add : blocktime check in recordListHandlerFn May 25, 2023
@0xsharma 0xsharma marked this pull request as ready for review May 25, 2023 13:06
@0xsharma 0xsharma merged commit 15c8aef into develop May 25, 2023
@0xsharma 0xsharma deleted the shivam/POS-1517 branch May 25, 2023 17:48
mh0lt pushed a commit to erigontech/erigon that referenced this pull request Dec 30, 2023
…se (#9103)

Users reported this error
```
[bor.heimdall] an error while trying fetching path=clerk/event-record/list attempt=5 error="unexpected end of JSON input"
```

Which may happen if:

1. Heimdall is behind and not sync-ed - for more info check
maticnetwork/heimdall#993
2. Or the header time erigon is sending is far into the future

The logs in this PR will help us see which of the 2 is the culprit but
most likely it is 1. We will investigate further 2. if it ever happens.

Changes:
1. Improves logging upon heimdall client retries - prints out the full
url that failed.
2. Fixes a bug where the body was incorrectly checked if it is empty -
`len(body) == 0` vs `body == nil`
3. Unit test for the bug regression
4. Adds a log to indicate to users to check their heimdall process if
they run into this scenario since that may be the culprit


Example output with new logs
<img width="1465" alt="Screenshot 2023-12-29 at 20 16 57"
src="https://github.com/ledgerwatch/erigon/assets/94537774/1ebfde68-aa93-41d6-889a-27bef5414f25">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants