erigon-pulse/consensus
milen b562eff482
heimdall: better error logging for clerk/event-record/list nil response (#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
https://github.com/maticnetwork/heimdall/pull/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">
2023-12-30 11:23:25 +00:00
..
aura Numerical instead of lexicographic sorting in borKeyValueConfigHelper (#8560) 2023-10-23 14:11:32 +02:00
bor heimdall: better error logging for clerk/event-record/list nil response (#9103) 2023-12-30 11:23:25 +00:00
clique Sentinel refactor (#8296) 2023-10-22 01:17:18 +02:00
ethash Sentinel refactor (#8296) 2023-10-22 01:17:18 +02:00
merge Introduce extra functions for BorSpans (no-op) (#8648) 2023-11-04 10:59:07 +00:00
misc erigon-lib: remove unused constants from protocol.go (#8644) 2023-11-03 10:20:36 +01:00
mock borheimdall: add test for span persistence (#8988) 2023-12-14 22:50:59 +02:00
chain_reader.go Introduce extra functions for BorSpans (no-op) (#8648) 2023-11-04 10:59:07 +00:00
consensus.go borheimdall: add test for span persistence (#8988) 2023-12-14 22:50:59 +02:00
errors.go Don't mark blocks as bad on transient errors (#8197) 2023-09-17 11:14:36 +02:00
result.go Clean up DEBUG category logs (#2776) 2021-10-05 08:14:04 +07:00