fix: compare poll endBlock against L1 block number instead of L2 on Arbitrum#213
Merged
rickstaa merged 1 commit intolivepeer:mainfrom Mar 4, 2026
Merged
Conversation
…rbitrum Poll tally handlers compared poll.endBlock (L1 scale, ~24M) against event.block.number (L2 scale, ~437M), causing the "poll ended" check to always pass. This prevented voteStake from updating after the initial vote, so stake changes (rewards, bonding, unbonding) during an active poll were never reflected in the tally. Replace event.block.number with getBlockNum() (which calls roundsManager.blockNum() and returns the L1 block number on Arbitrum) so both sides of the comparison are on the same scale. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Member
|
@adamsoffer good find. Approved, as logic checks out will run some validations and then we can merge and publish a patched version. |
rickstaa
approved these changes
Mar 4, 2026
Member
|
This was validated by @adamsoffer in https://gist.github.com/adamsoffer/fb0b241203ca54f696fdeab0a5be62f9. |
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
updatePollTallyOnReward,OnBond,OnUnbond,OnRebond) comparepoll.endBlockagainstevent.block.numberto check if a poll is still active. On Arbitrum,poll.endBlockis on the L1 block scale (~24M) since Solidity'sblock.numberreturns L1-approximate values, butevent.block.numberin The Graph is the L2 sequential block (~437M). The check always evaluates as "poll ended," sovoteStakenever updates after the initial vote.event.block.numberwithgetBlockNum()(which callsroundsManager.blockNum()and returns the L1 block number) in all three endBlock checks so both sides of the comparison are on the same scale.Evidence
Comparing
voteStake(Vote entity) vstotalStake(Transcoder entity) for orchestrators withnonVoteStake: 0on the current active poll (0x9bddf5c1766924e5ea601eb0bb00dc022f5980d0):0xbd677e...22bd0x5d98...5e600x9d61...e3c8The gap grows proportionally with time since the vote (accumulated daily rewards). Reward events fire and update
Transcoder.totalStakecorrectly, but the poll tally handlers skip thevoteStakeupdate because they think the poll has already ended.Test plan
yarn prepare && yarn build)voteStakeupdates on subsequent Reward/Bond/Unbond/Rebond events for active polls🤖 Generated with Claude Code