Skip to content
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

migration: update migrated withdrawal gas limit #4911

Merged
merged 4 commits into from
Mar 9, 2023
Merged

Conversation

tynes
Copy link
Contributor

@tynes tynes commented Feb 17, 2023

Description

More accurately computes the gas limit for a migrated withdrawal. This is useful to prevent the gaslimit for large transactions from going over the consensus level block gas limit. It is unlikely for a transaction to go over the block gas limit, but this is a preventative fix just in case.

Closes CLI-3336

@tynes tynes requested review from a team as code owners February 17, 2023 00:46
@changeset-bot
Copy link

changeset-bot bot commented Feb 17, 2023

🦋 Changeset detected

Latest commit: 43c4158

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@eth-optimism/sdk Patch
@eth-optimism/chain-mon Patch
@eth-optimism/message-relayer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mergify mergify bot added the sdk label Feb 17, 2023
@codecov
Copy link

codecov bot commented Feb 17, 2023

Codecov Report

Merging #4911 (43c4158) into develop (fe19972) will decrease coverage by 3.35%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #4911      +/-   ##
===========================================
- Coverage    41.00%   37.65%   -3.35%     
===========================================
  Files          339      233     -106     
  Lines        20789    17696    -3093     
  Branches       771      169     -602     
===========================================
- Hits          8524     6664    -1860     
+ Misses       11610    10412    -1198     
+ Partials       655      620      -35     
Flag Coverage Δ
bedrock-go-tests 36.73% <100.00%> (+0.06%) ⬆️
contracts-bedrock-tests ?
contracts-tests ?
core-utils-tests 60.41% <ø> (ø)
dtl-tests 47.15% <ø> (ø)
fault-detector-tests 33.88% <ø> (ø)
sdk-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
op-chain-ops/crossdomain/migrate.go 58.10% <100.00%> (+11.55%) ⬆️
packages/sdk/src/cross-chain-messenger.ts
packages/sdk/src/utils/message-utils.ts
packages/sdk/src/interfaces/index.ts
...racts/contracts/libraries/utils/Lib_BytesUtils.sol
...ts-bedrock/contracts/deployment/SystemDictator.sol
...ntracts/libraries/resolver/Lib_AddressResolver.sol
packages/sdk/src/adapters/standard-bridge.ts
...ackages/contracts-bedrock/contracts/L2/L1Block.sol
...tracts-bedrock/contracts/L2/CrossDomainOwnable.sol
... and 97 more

@tynes tynes requested review from smartcontracts and removed request for protolambda and roninjin10 February 17, 2023 01:04
@mergify mergify bot requested a review from roninjin10 February 17, 2023 01:04
@tynes
Copy link
Contributor Author

tynes commented Feb 21, 2023

Addressed the review comment by @smartcontracts, this should be good to merge

@tynes tynes requested review from maurelian and removed request for roninjin10 February 22, 2023 19:46
@mergify mergify bot requested a review from roninjin10 February 22, 2023 19:46
Copy link
Contributor

@maurelian maurelian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks about right to me, but I think its worthwhile to update the tests to check:

  1. the gas calculation for a string with some mix of 0 and non-zero bytes
  2. the gasLimit respects the 25_000_000 boundary

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2023

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 9, 2023
@tynes tynes removed the Stale label Mar 9, 2023
More accurately computes the gas limit for a migrated
withdrawal. This is useful to prevent the gaslimit
for large transactions from going over the consensus
level block gas limit. It is unlikely for a transaction
to go over the block gas limit, but this is a preventative
fix just in case.
@tynes
Copy link
Contributor Author

tynes commented Mar 9, 2023

@maurelian There are now tests in both go and js - ready for review again

@mslipper mslipper merged commit 6e83695 into develop Mar 9, 2023
@mslipper mslipper deleted the fix/gaslimit branch March 9, 2023 20:36
tynes added a commit that referenced this pull request Apr 17, 2023
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.
nitaliano pushed a commit that referenced this pull request May 20, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants