-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(op-acceptance-tests): l2cm upgrade accaptance tests and fork tests on karst betanet #20668
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
base: develop
Are you sure you want to change the base?
Changes from all commits
0179e8a
9782ee9
a118a9c
329e54d
0a8fe52
1971c09
a12f6d0
e2eb850
81bcb09
da9943e
331ce17
96f15bc
7cd0a82
71506e6
fff70c2
d292e28
e05e520
5185926
ba4153b
33b1700
373b1ee
281e44a
521f991
2017222
9f54a9c
c1181f3
ba75e97
599e4a9
bdd84c8
c9ea936
d4711ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| package karst | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/ethereum-optimism/optimism/op-acceptance-tests/tests/base/withdrawal" | ||
| gameTypes "github.com/ethereum-optimism/optimism/op-challenger/game/types" | ||
| opforks "github.com/ethereum-optimism/optimism/op-core/forks" | ||
| "github.com/ethereum-optimism/optimism/op-devstack/presets" | ||
| "github.com/ethereum-optimism/optimism/op-devstack/sysgo" | ||
| ) | ||
|
|
||
| // TestWithdrawal_Karst creates a withdrawal from the L2StandardBridge and | ||
| // observes the full withdrawal flow, including finalization on L1. | ||
| func TestWithdrawal_Karst(gt *testing.T) { | ||
| withdrawal.TestWithdrawal(gt, gameTypes.CannonGameType, | ||
| presets.WithDeployerOptions(sysgo.WithKarstAtGenesis), | ||
| ) | ||
| } | ||
|
|
||
| // TestWithdrawal_KarstUpgrade is the same withdrawal flow but on a network that | ||
| // started pre-Karst and activated Karst mid-chain via a scheduled upgrade. | ||
| func TestWithdrawal_KarstUpgrade(gt *testing.T) { | ||
| offset := uint64(10) // arbitrary offset to have a few blocks before Karst | ||
| withdrawal.TestWithdrawalAfterUpgrade(gt, gameTypes.CannonGameType, opforks.Karst, | ||
| presets.WithDeployerOptions(sysgo.WithKarstAtOffset(&offset)), | ||
| ) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -289,13 +289,30 @@ library Config { | |
| return vm.envOr("L2_FORK_TEST", false); | ||
| } | ||
|
|
||
| /// @notice Returns true if this is a L2CM activation test. | ||
| function l2CMActivationTest() internal view returns (bool) { | ||
| return vm.envOr("L2CM_ACTIVATION_TEST", false); | ||
| } | ||
|
|
||
| /// @notice Returns the L2 RPC URL for forking. | ||
| function l2ForkRpcUrl() internal view returns (string memory) { | ||
| return vm.envString("L2_FORK_RPC_URL"); | ||
| } | ||
|
|
||
| /// @notice Returns the L2 block after the fork. | ||
| function l2BlockAfterFork() internal view returns (uint256) { | ||
| if (l2CMActivationTest()) { | ||
| return vm.envOr("L2_FORK_BLOCK_NUMBER", uint256(0)); | ||
|
Contributor
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. I think this needs to be fixed before merge. The justfile documents Could we do one of the following:
The pre/post activation flow can become:
Author
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. |
||
| } | ||
| revert("Config: l2BlockAfterFork called outside of L2CM activation test"); | ||
| } | ||
|
|
||
| /// @notice Returns the L2 block number to fork at. Defaults to 0 (latest). | ||
| /// If L2CM activation test is enabled, returns the block before the fork. | ||
| function l2ForkBlockNumber() internal view returns (uint256) { | ||
| if (l2CMActivationTest()) { | ||
| return vm.envUint("L2_BLOCK_BEFORE_FORK"); | ||
| } | ||
|
Comment on lines
+313
to
+315
Contributor
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. would it be better to have this its own getter?
Author
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. this is the only place where it's used, as we are taking advantage of the existing test setup which forks based on this getter. |
||
| return vm.envOr("L2_FORK_BLOCK_NUMBER", uint256(0)); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.