-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganized storage slots and variable types in BridgeState
All `*Timeout` values in `BridgeState` are represented as `uint32` now. All `*RewardMultiplier` values in `BridgeState` are represented as `uint32` now. `__depositAlignmentGap` changed to `bytes16` to really move `movingFundsTxMaxTotalFee` to the next storage slot (previous `bytes8` version was not doing it). Added `bytes16 __movingFundsAlignmentGap` to keep as one slot: `uint96 movingFundsTimeoutSlashingAmount | uint32 movingFundsTimeoutNotifierRewardMultiplier | bytes16 movingFundsTimeoutSlashingGap` This change allows to make timeout and reward multiplier values use consistent types as well as reduce gas consumption a bit. Before vs after: | Bridge · revealDeposit · 103961 · 108365 · 104924 │ | Bridge · revealDeposit · 103961 · 108365 · 104925 │ | Bridge · submitDepositSweepProof · 191029 · 346180 · 267960 │ | Bridge · submitDepositSweepProof · 191007 · 346158 · 267938 │ | Bridge · submitRedemptionProof · 126351 · 197632 · 168338 │ | Bridge · submitRedemptionProof · 126278 · 197535 · 168253 │ | Bridge · requestRedemption · 113740 · 131575 · 121303 │ | Bridge · requestRedemption · 113734 · 131563 · 121292 │ | Bridge · submitMovedFundsSweepProof · 134172 · 147375 · 139461 │ | Bridge · submitMovedFundsSweepProof · 134172 · 147375 · 139461 │
- Loading branch information
Showing
4 changed files
with
34 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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