feat(ctb): Account for worst-case CALL gas in SafeCall#5470
feat(ctb): Account for worst-case CALL gas in SafeCall#5470OptimismBot merged 2 commits intodevelopfrom
CALL gas in SafeCall#5470Conversation
|
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
✅ Deploy Preview for opstack-docs canceled.
|
b5c2a44 to
2201cee
Compare
packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol
Outdated
Show resolved
Hide resolved
Clean up the script that is used to migrate legacy withdrawals. This script is very important for testing the legacy withdrawal migration. A bug was introduced with #4911 which was a sherlock audit fix. This was a bug because the change resulted in the withdrawal hashes changing, meaning that the storage slots computed client side also changed. This resulted in breaking the script. This commit reverts this change. The changes landing in #5470 will cause the buffer in the gas limit for the migrated withdrawals to be too small, so we can reintroduce this code behind a switch with the network. Its not ideal that the migration code isn't going to match 1:1 with goerli but thats ok because we will be able to thoroughly test it.
|
Fixes CLI-3832 |
|
Hey @clabby! This PR has merge conflicts. Please fix them before continuing review. |
2201cee to
ec0adb7
Compare
ec0adb7 to
0dfefff
Compare
0dfefff to
bc124c4
Compare
|
Semgrep found 2
Unchecked type assertion. Created by unchecked-type-assertion. |
bc124c4 to
5b8ab37
Compare
packages/contracts-bedrock/contracts/L2/L2CrossDomainMessenger.sol
Outdated
Show resolved
Hide resolved
38bc389 to
cfb60fb
Compare
cfb60fb to
f7e83ad
Compare
refcell
left a comment
There was a problem hiding this comment.
Few comments, otherwise looks great!
packages/contracts-bedrock/contracts/L2/L2CrossDomainMessenger.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/contracts/universal/CrossDomainMessenger.sol
Outdated
Show resolved
Hide resolved
refcell
left a comment
There was a problem hiding this comment.
This looks pretty ironed out to me at this point pending other's reviews.
|
Waiting for @tynes' approval to remove the |
|
Do you mind squashing this PR in a commit or a few commits? |
c136b42 to
48ef885
Compare
48ef885 to
1c61224
Compare
|
This PR has been added to the merge queue, and will be merged soon. |
|
This PR is next in line to be merged, and will be merged as soon as checks pass. |
…Gas` Adjusts `SafeCall.callWithMinGas` to account for the worst-case cost of 3/5 of the `CALL` opcode's dynamic gas factors: - `address_access_cost` - `positive_value_cost` - `value_to_empty_account_cost` As for `memory_expansion_cost` & `code_execution_cost`, these are expected to be covered by the `minGasLimit` itself. Also removes the division from `hasMinGas` for extra precision. See: - ethereum-optimism/optimism#5470 - ethereum-optimism/optimism#5540
Clean up the script that is used to migrate legacy withdrawals. This script is very important for testing the legacy withdrawal migration. A bug was introduced with #4911 which was a sherlock audit fix. This was a bug because the change resulted in the withdrawal hashes changing, meaning that the storage slots computed client side also changed. This resulted in breaking the script. This commit reverts this change. The changes landing in #5470 will cause the buffer in the gas limit for the migrated withdrawals to be too small, so we can reintroduce this code behind a switch with the network. Its not ideal that the migration code isn't going to match 1:1 with goerli but thats ok because we will be able to thoroughly test it.

Overview
Adjusts
SafeCall.callWithMinGasto account for the worst-case cost of 3/5 of theCALLopcode's dynamic gas factors:address_access_costpositive_value_costvalue_to_empty_account_costAs for
memory_expansion_cost&code_execution_cost, these are expected to be covered by theminGasLimititself.