Skip to content

fix: use flat JSON format for seid /status response parsing#39

Merged
bdchatham merged 1 commit intomainfrom
fix/status-response-format
Mar 20, 2026
Merged

fix: use flat JSON format for seid /status response parsing#39
bdchatham merged 1 commit intomainfrom
fix/status-response-format

Conversation

@bdchatham
Copy link
Contributor

Summary

  • 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 — strconv.ParseInt("") returned an error each time — leaving the await-condition task stuck indefinitely even after the target height was reached.
  • Same wrapper assumption existed in result_export.go for both /status and /block_results endpoints; fixed both.

Root cause

Discovered while debugging a pacific-1-shadow-replayer pre-init Job where seid had 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 for latest_block_height.

Test plan

  • All existing tests updated to use the flat format and pass
  • go test ./sidecar/... -count=1 — all 7 packages pass

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.
@bdchatham bdchatham marked this pull request as ready for review March 20, 2026 14:08
@bdchatham bdchatham merged commit e9353d9 into main Mar 20, 2026
2 checks passed
@bdchatham bdchatham deleted the fix/status-response-format branch March 20, 2026 14:09
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.

1 participant