fix: use flat JSON format for seid /status response parsing#39
Merged
fix: use flat JSON format for seid /status response parsing#39
Conversation
The statusResponse struct expected a JSONRPC result wrapper
({"result":{"sync_info":{...}}}) but seid returns a flat format
({"sync_info":{...}}). This caused LatestHeight to silently fail
on every poll, leaving the await-condition task stuck indefinitely
even after the target height was reached.
Also fixes the same wrapper assumption in result_export.go for
both /status and /block_results endpoints.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
statusResponsestruct expected a JSONRPCresultwrapper ({"result":{"sync_info":{...}}}) but seid returns a flat format ({"sync_info":{...}}). This causedLatestHeightto silently fail on every poll —strconv.ParseInt("")returned an error each time — leaving theawait-conditiontask stuck indefinitely even after the target height was reached.result_export.gofor both/statusand/block_resultsendpoints; fixed both.Root cause
Discovered while debugging a
pacific-1-shadow-replayerpre-init Job whereseidhad synced past the target height (198.8M vs 198.7M target) but the sidecar task never detected it. The TCP connection was established and HTTP 200s were flowing, but the JSON parse always produced an empty string forlatest_block_height.Test plan
go test ./sidecar/... -count=1— all 7 packages pass