Repository navigation
fix(sidecar): confirm a GovVote from the gov module when the tx index is off - #604
Conversation
… is off GovVote targets validators, and most run with the tx index off. The sidecar could not look up the vote tx, so the task ended Failed with 'inclusion unverifiable' even when the vote landed. #603 fixed the same case for Unjail. When the tx is unverifiable, the handler now polls the gov vote query (proposal, voter) for up to 30 seconds. A recorded vote with the requested option as its one full-weight choice completes the task; the result keeps the tx hash and the unverifiable inclusion status. A different or missing vote keeps the terminal error. The wire docs and the GovVote kind comment name the new exception. Refs: PLT-1401 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@seidroid review |
PR SummaryMedium Risk Overview Vote reads use the same off-goroutine + context cancel pattern as Unjail, refuse reads while the node is catching up, and expose test seams on Reviewed by Cursor Bugbot for commit 978ad7b. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
@seidroid review |
There was a problem hiding this comment.
When the node's tx index is off and the broadcast comes back Unverifiable, GovVote now polls the gov module's vote query for up to 30s and completes the task once the recorded choice is the requested full-weight option, following the pattern #603 used for Unjail. Nothing blocks: the confirmation logic, the deadline handling and the new tests are sound, and one suggestion remains about not guarding against a catching-up node; tests were not run because the sandbox has no Go toolchain.
Non-blocking
1 finding on the changed lines, as inline comments.
- Reconciling the other readings: I dropped codex's medium finding at gov_vote.go:190 about
chainVoteleaking a goroutine and RPC past the deadline. The abandoned goroutine writes to a buffered channel, so it never blocks. Its RPC runs over therpchttp.NewWithTimeout(..., tmRPCTimeout)client (transactions.go:37), so it ends within 30s instead of piling up, the same bounded behavior as the existingchainJailStatethis code copies.
seidroid review · decision approve · session e41e4e2f5f33432793674451d12470bf · turn resp_claude_b9b039f39e8ac0f0fe0a8df147613359 · item 7197519a76f65a9fae65186e11feb4fd
Findings: 0 blocking | 2 non-blocking | 1 posted inline
Review on #604: a lagging node can still show an older vote with the requested option after a newer vote replaced it. readVoteState checks /status first and returns an error while the node catches up, so the confirmation keeps polling, as the Unjail jail-state read does. Refs: PLT-1401 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@seidroid review |
There was a problem hiding this comment.
Since the last review, chainVote reads through a new readVoteState. That function checks /status first and returns an error while the node is catching up, so votedAfter keeps polling instead of trusting a stale vote; TestReadVoteState tests both the catching-up and caught-up cases. That fixes my catching-up finding, nothing else blocks, and I again dropped codex's repeated goroutine-leak claim at gov_vote.go:191: the abandoned goroutine writes to a buffered channel and its RPC runs over the client built with the 30s tmRPCTimeout, so it exits on its own and leaves nothing behind, as in the existing chainJailState.
seidroid review · decision approve · session e41e4e2f5f33432793674451d12470bf · turn resp_claude_3ecd340b69c7ebe0d23ece986cc487cc · item c8af85538227597fabcbaf2e820b74dd
Findings: 0 blocking | 0 non-blocking | 0 posted inline
Summary
GovVotetargets validators, and most validators run with the tx index off. The sidecar then cannot look up the vote tx, and the task ends Failed withinclusion unverifiable, even when the vote landed. #603 fixed the same case forUnjail; this PR applies the pattern toGovVote(PLT-1401).Change
Unverifiable, the handler polls the gov module's vote query (proposal ID plus voter) for up to 30 seconds, once a second, under a context deadline.inclusionStatus: unverifiable.chainJailStatedoes, because the SDK query path does not honor the context.Voteholds noAny, so the fix(sidecar): unpack the validator consensus key before the unjail jail-state read #602 unpack issue cannot occur.classifyGovResult, and theGovVotekind comment now name the second state-confirmed task.Verification
gofmt,go vet,golangci-lint --new-from-merge-base, andgo test ./....make manifests generateleaves no diff.Refs: PLT-1401
🤖 Generated with Claude Code