fix: compare poll endBlock against L1 block number instead of L2 on Arbitrum#214
Closed
fix: compare poll endBlock against L1 block number instead of L2 on Arbitrum#214
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>
|
🚀 Subgraph Studio preview deployed
curl -H 'Content-Type: application/json' \
-d '{"query":"{ protocol(id: \"0\") { inflation } }"}' \
https://api.studio.thegraph.com/query/31909/livepeer-ci/pr-214-c369367-22675072446 |
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.
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
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Fixes # (issue)
Checklist
yarn prepareand verifiedyarn codegenandyarn buildsucceed.yarn deploy:local.