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

Indexer panics if height not found on rpc #39

Open
gusin13 opened this issue Nov 12, 2024 · 1 comment
Open

Indexer panics if height not found on rpc #39

gusin13 opened this issue Nov 12, 2024 · 1 comment

Comments

@gusin13
Copy link
Collaborator

gusin13 commented Nov 12, 2024

{"level":"debug","time":"2024-11-12T09:24:02Z","message":"Fetched 25 events from block 31452"}
{"level":"debug","time":"2024-11-12T09:24:02Z","message":"Fetched 25 events from block 31453"}
{"level":"info","time":"2024-11-12T09:24:02Z","message":"Processed blocks up to height 31453"}
{"level":"debug","last_processed_height":31453,"latest_height":31454,"time":"2024-11-12T09:24:33Z","message":"Received new block height"}
{"level":"debug","time":"2024-11-12T09:24:33Z","message":"Fetched 25 events from block 31453"}
{"level":"fatal","time":"2024-11-12T09:24:33Z","message":"BBN block processor exited with error: error in json rpc client, with http response metadata: (Status: 200 OK, Protocol HTTP/1.1). RPC error -32603 - Internal error: could not find results for height #31454"}

indexer tries to fetch block at height but rpc errs (even after retries - a recent fix)

@gusin13
Copy link
Collaborator Author

gusin13 commented Nov 12, 2024

its possible the retry logic not working as expected, double check the string parse logic

if strings.Contains(
err.Err.Error(),
"must be less than or equal to the current blockchain height",
) {
log.Debug().
Str("block_height", fmt.Sprintf("%d", *blockHeight)).
Str("backoff", backoff.String()).
Msg("Block not yet available, retrying...")
time.Sleep(backoff)
backoff *= backoffFactor
continue

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

No branches or pull requests

1 participant