Skip to content

fix: compare poll endBlock against L1 block number instead of L2 on Arbitrum#214

Closed
rickstaa wants to merge 1 commit intomainfrom
fix/endblock-fix
Closed

fix: compare poll endBlock against L1 block number instead of L2 on Arbitrum#214
rickstaa wants to merge 1 commit intomainfrom
fix/endblock-fix

Conversation

@rickstaa
Copy link
Member

@rickstaa rickstaa commented Mar 4, 2026

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

  • Ran yarn prepare and verified yarn codegen and yarn build succeed.
  • (Optional) Validated locally with yarn deploy:local.
  • Confirmed the Subgraph Studio preview link in the PR comment works and the subgraph syncs without errors.

…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>
@github-actions
Copy link

github-actions bot commented Mar 4, 2026

🚀 Subgraph Studio preview deployed

Item Details
Version label pr-214-c369367-22675072446
Query endpoint https://api.studio.thegraph.com/query/31909/livepeer-ci/pr-214-c369367-22675072446
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

@rickstaa rickstaa closed this Mar 4, 2026
@rickstaa rickstaa reopened this Mar 4, 2026
@rickstaa rickstaa closed this Mar 4, 2026
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.

2 participants