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

fix: check response before unmarshaling #46

Merged
merged 2 commits into from
Dec 6, 2024
Merged

Conversation

lesterli
Copy link
Contributor

@lesterli lesterli commented Dec 5, 2024

Summary

We saw the following unmarshalling error in the FG logs.

2024-11-24T01:27:45.282737Z	info	Processing new blocks	{"start_height": 138620, "end_height": 138622}
2024-11-24T01:27:45.282774Z	info	Processing batch of blocks	{"batch_start_height": 138620, "batch_end_height": 138622}
2024-11-24T01:27:46.315131Z	error	Error checking if block is finalized from babylon	{"block_height": 138622, "error": "error in json rpc client, with http response metadata: (Status: 502 Bad Gateway, Protocol HTTP/1.1). error unmarshalling: invalid character 'e' looking for beginning of value"}
2024-11-24T01:27:46.315187Z	fatal	Error processing blocks	{"error": "error processing block 138622: error checking is block 138622 finalized from babylon: error in json rpc client, with http response metadata: (Status: 502 Bad Gateway, Protocol HTTP/1.1). error unmarshalling: invalid character 'e' looking for beginning of value"}

Upon checking the code, the error is thrown in the QueryIsBlockBabylonFinalizedFromBabylon function, and only cw-related functions involve JSON unmarshalling, this PR checks the response before unmarshaling it.

Test Plan

make lint
make test

@lesterli lesterli merged commit ac0ac99 into main Dec 6, 2024
11 checks passed
@lesterli lesterli deleted the fix/unmarshalling-error branch December 6, 2024 01:12
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.

3 participants