-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bridge gas optimisations #301
Merged
Merged
Changes from 23 commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
15d4347
Improve script identification in extractPubKeyHash and add utility fu…
eth-r 46975d6
Remove unnecessary allocation from processRedemptionTxOutputs
eth-r 22d22d8
Use extractHashAt
eth-r 94c7929
Simplify script payload check in requestRedemption
eth-r fc54959
Change redemption key calculation to non-allocating
eth-r 9282004
Align storage slots in BridgeState to streamline deposits
eth-r 1794b5c
Align BridgeState to streamline redemption operations
eth-r d062d5b
Align BridgeState to streamline fraud handling
eth-r 5aedcc0
Add alignment gap for redemption
eth-r 00fa2e8
Align BridgeState to streamline moving funds
eth-r 8934e9c
Align BridgeState to streamline relay use
eth-r 299d696
Remove allocations from submitRedemptionProof
eth-r f3168fa
Merge branch 'main' into bridge-opt
eth-r 4043e38
Build scripts in processRedemptionTxOutputs more efficiently
eth-r b606672
Merge branch 'main' into bridge-opt
eth-r d8d15db
Merge branch 'main' into bridge-opt
eth-r 6c23186
Update bitcoin-spv version
eth-r 6e8c105
Updated lockfile for 3.4.0-solc-0.8 of bitcoin-spv-sol
pdyraga b8091d2
Merge branch 'main' into bridge-opt
eth-r 2da7683
Merge remote-tracking branch 'origin/bridge-opt' into bridge-opt
eth-r d5f4ccf
Update redemption key calculations in vault tests
eth-r d38ba95
Fix linting issues
eth-r 2027551
Actually fix formatting issues
eth-r 7cae2a8
Explain BridgeState alignment gaps in comments
eth-r f4ff905
Fix function documentation comment formatting
eth-r ab98d8b
Ignore reentrancy-events detector in requestRedemption
pdyraga 617d2e4
Merge branch 'main' into bridge-opt
pdyraga File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,7 +239,7 @@ contract Bridge is | |
address _relay, | ||
address _treasury, | ||
address _ecdsaWalletRegistry, | ||
uint256 _txProofDifficultyFactor | ||
uint96 _txProofDifficultyFactor | ||
) external initializer { | ||
require(_bank != address(0), "Bank address cannot be zero"); | ||
self.bank = Bank(_bank); | ||
|
@@ -1228,9 +1228,9 @@ contract Bridge is | |
uint64 redemptionDustThreshold, | ||
uint64 redemptionTreasuryFeeDivisor, | ||
uint64 redemptionTxMaxFee, | ||
uint256 redemptionTimeout, | ||
uint64 redemptionTimeout, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to revisit events because they still use old types. Example:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
uint96 redemptionTimeoutSlashingAmount, | ||
uint256 redemptionTimeoutNotifierRewardMultiplier | ||
uint64 redemptionTimeoutNotifierRewardMultiplier | ||
) external onlyGovernance { | ||
self.updateRedemptionParameters( | ||
redemptionDustThreshold, | ||
|
@@ -1315,7 +1315,7 @@ contract Bridge is | |
uint64 movedFundsSweepTxMaxTotalFee, | ||
uint32 movedFundsSweepTimeout, | ||
uint96 movedFundsSweepTimeoutSlashingAmount, | ||
uint256 movedFundsSweepTimeoutNotifierRewardMultiplier | ||
uint64 movedFundsSweepTimeoutNotifierRewardMultiplier | ||
) external onlyGovernance { | ||
self.updateMovingFundsParameters( | ||
movingFundsTxMaxTotalFee, | ||
|
@@ -1395,10 +1395,10 @@ contract Bridge is | |
/// - Fraud challenge defeat timeout must be greater than 0, | ||
/// - Fraud notifier reward multiplier must be in the range [0, 100]. | ||
function updateFraudParameters( | ||
uint256 fraudChallengeDepositAmount, | ||
uint256 fraudChallengeDefeatTimeout, | ||
uint96 fraudChallengeDepositAmount, | ||
uint32 fraudChallengeDefeatTimeout, | ||
uint96 fraudSlashingAmount, | ||
uint256 fraudNotifierRewardMultiplier | ||
uint32 fraudNotifierRewardMultiplier | ||
) external onlyGovernance { | ||
self.updateFraudParameters( | ||
fraudChallengeDepositAmount, | ||
|
@@ -1607,9 +1607,9 @@ contract Bridge is | |
uint64 redemptionDustThreshold, | ||
uint64 redemptionTreasuryFeeDivisor, | ||
uint64 redemptionTxMaxFee, | ||
uint256 redemptionTimeout, | ||
uint64 redemptionTimeout, | ||
uint96 redemptionTimeoutSlashingAmount, | ||
uint256 redemptionTimeoutNotifierRewardMultiplier | ||
uint64 redemptionTimeoutNotifierRewardMultiplier | ||
) | ||
{ | ||
redemptionDustThreshold = self.redemptionDustThreshold; | ||
|
@@ -1748,10 +1748,10 @@ contract Bridge is | |
external | ||
view | ||
returns ( | ||
uint256 fraudChallengeDepositAmount, | ||
uint256 fraudChallengeDefeatTimeout, | ||
uint96 fraudChallengeDepositAmount, | ||
uint32 fraudChallengeDefeatTimeout, | ||
uint96 fraudSlashingAmount, | ||
uint256 fraudNotifierRewardMultiplier | ||
uint32 fraudNotifierRewardMultiplier | ||
) | ||
{ | ||
fraudChallengeDepositAmount = self.fraudChallengeDepositAmount; | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could note why it's
- 8
, something like:This could be helpful, especially that later we also
slice32(8)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #345 in 9aeb58c.