MixinReserve.claimableReserve() mid-round accounting mismatch when transcoder pool size and current-round active set diverge
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Quiet
- Tech stack
- solidity
- Domain
- blockchain, security
Research direction
Start with contracts/pm/mixins/MixinReserve.sol, then trace MixinTicketBrokerCore.redeemWinningTicket() and BondingManager.resignTranscoder() or tryToJoinActiveSet(). The issue describes a documented, out-of-scope accounting mismatch and does not specify a code change or acceptance test, so no concrete completion condition is provided.
Written by the indexing model from the issue text.
Description
Summary
MixinReserve.claimableReserve() reads two data structures that can fall out of sync within one round. Claimant eligibility is gated on bondingManager().isActiveTranscoder(_claimant) (a current-round snapshot), while the reserve allocation is divided by bondingManager().getTranscoderPoolSize() (the live pending transcoder pool counter). When the pending pool shrinks or grows mid-round (e.g. via resignTranscoder() or tryToJoinActiveSet()), the eligible active set and the divisor diverge, causing the per-claimant reserve cap to deviate from the fair R / N allocation in either direction.
Root cause
isActiveTranscoder() is gated on activationRound <= currentRound < deactivationRound, which is a round-level snapshot. getTranscoderPoolSize() returns the live size of the transcoderPool linked list, which is mutated immediately by bonds, unbonds, evictions, and resignations.
When an active transcoder fully unbonds in round r:
resignTranscoder()removes them fromtranscoderPoolimmediately, sogetTranscoderPoolSize()returnsN - 1.- It sets
deactivationRound = currentRound + 1, soisActiveTranscoder()still returnstruefor the remainder of roundr.
The set of eligible claimants has size N, but the divisor is N - 1. Every eligible share is inflated by N / (N - 1). The symmetric case (new transcoder joining via tryToJoinActiveSet() when a slot is free) deflates the cap in the same way.
Why it's not an issue
- No theft. The redeemed amount is bounded by the ticket's
faceValueand can never exceed the face value the broadcaster explicitly signed. No funds are created beyond what the broadcaster committed. - Grief is temporary.
claimFromReserveis explicitly designed to paymin(shortfall, claimableReserve), not the full face value. Partial reserve payment for a valid ticket is normal protocol behavior. After a revert,usedTickets[hash]remains false and the ticket can be retried in a later round (subject toticketValidityPeriod). - Restrictive preconditions. The attack requires (1) a valid pre-signed winning ticket where
faceValue - deposit > R / N, (2) the attacker accepting the opportunity cost of fully unbonding (or coordinating with a separate pool-shrinker), and (3) no other transcoder bonding into the freed slot between the pool shrink and the redeem call. Splitting the pool-shrinker and the overclaimer into separate accounts reintroduces a race: the pool shrink and the redemption can no longer be bundled into one transaction, so any transcoder bonding into the free slot between the two steps restores the pool size and cancels the inflation. - Protocol spec acknowledges the behavior. The Livepeer technical spec documents a scenario where an orchestrator sets their ticket's face value to
R / N, but by the time they redeem, the active set has grown toN + 1, dropping the cap toR / (N + 1). This is treated as a known limitation of the reserve mechanism. The invariantclaimableReserve == R / active_set_size at all timesis not guaranteed by the spec.
Out of scope for bug bounty
Reports targeting the claimableReserve accounting mismatch in MixinReserve.sol, and the associated griefing/payment-disruption paths through MixinTicketBrokerCore.redeemWinningTicket(), BondingManager.resignTranscoder(), or BondingManager.tryToJoinActiveSet(), are closed as known issues and not eligible for rewards under the Livepeer Immunefi bug bounty program.
References
- Source:
contracts/pm/mixins/MixinReserve.sol - Related:
contracts/pm/mixins/MixinTicketBrokerCore.sol,contracts/bonding/BondingManager.sol - Deployed TicketBroker (Arbitrum):
0xa8bB618B1520E284046F3dFc448851A1Ff26e41B
- Dominant language
- JavaScript
- Stars
- 155
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from livepeer/protocol
-
known-issue
Difficulty 4/5 3-5 days Newbie friendliness 30/100
-
Winning tickets can settle for less than their face value once the recipient’s reserve is exhaustedOpenknown-issue
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
blockchain enhancement pm
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
known-issue
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 42/100
All issues in livepeer/protocol
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
saadeghi/daisyui#4780 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
accessibility bug embed websites
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
quarto-dev/quarto-cli#14972 ·
Maintainers usually reply within 1 day
-
has-readme needs-attention new-tool repo-verified
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
shanselman/TinyToolTown#834 · 2 comments ·
Maintainers usually reply within 6 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
siderolabs/talos-design-system#16 ·
Maintainers usually reply within 1 day