Lines of code
<https://github.com/code-423n4/2023-08-livepeer/blob/a3d801fa4690119b6f96aeb5508e58d752bda5bc/contracts/bonding/BondingManager.sol#L1459>
This allows a transcoder to increase their voting power without actually increasing their stake.
The relevant code that uses increaseTotalStakeUncheckpointed() and skips transcoder state checkpointing is in the updateTranscoderWithRewards() function: <https://github.com/code-423n4/2023-08-livepeer/blob/a3d801fa4690119b6f96aeb5508e58d752bda5bc/contracts/bonding/BondingManager.sol#L1488>
Using increaseTotalStakeUncheckpointed() instead of increaseTotalStake() can lead to inconsistent transcoder state.
The key difference is that increaseTotalStake() has an autoCheckpoint modifier which calls _checkpointBondingState(), while increaseTotalStakeUncheckpointed() does not.
_checkpointBondingState() updates the historical record of the transcoderโs stake and reward state via the BondingVotes contract. This historical record is used for calculating voting power in the governance system.
By skipping the checkpoint, increaseTotalStakeUncheckpointed() causes the transcoderโs voting power to become inconsistent with its actual stake.
For example:
Manual
increaseTotalStakeUncheckpointed() should only be used in cases where the caller guarantees it will checkpoint the state later, like in processRebond(). For general stake increases, increaseTotalStake() should be used.
Other
The text was updated successfully, but these errors were encountered:
All reactions