-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* op-e2e: Nuke allocs This PR integrates op-deployer with op-e2e for the purposes of generating L1/L2 allocs on-the-fly. As a result, there is no longer any need to run `make devnet-allocs` or otherwise continue maintaining the legacy Python devnet. The generated allocs are at parity with those generated by the Python devnet - i.e., they contain the Alphabet VM, the fast fault game, and the deploy config customizations in `devnetL1.json`. One notable change here is that the ability to generate new allocs files for L2OO chains will no longer be possible post-Holocene. To continue supporting the L2OO tests for the time being, the L2OO allocs files have been archived at the Holocene fork. Cleaning up the old devnet will be handled separately. * fix broken tests * bring back l2oo test * swap more keys * more keys * swap prestates * remove dead code * fix prestate proof * Code review updates * toml fields
- Loading branch information
Showing
40 changed files
with
763 additions
and
166 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package opcm | ||
|
||
import ( | ||
"fmt" | ||
"math/big" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/lmittmann/w3" | ||
) | ||
|
||
var anchorRootFunc = w3.MustNewFunc(` | ||
dummy((uint32 gameType, (bytes32 root, uint256 l2BlockNumber) outputRoot)[] roots) | ||
`, "") | ||
|
||
type StartingAnchorRoot struct { | ||
GameType uint32 | ||
Root common.Hash | ||
L2BlockNumber *big.Int | ||
} | ||
|
||
var DefaultStartingAnchorRoot = StartingAnchorRoot{ | ||
GameType: 1, | ||
Root: common.Hash{0xde, 0xad}, | ||
L2BlockNumber: common.Big0, | ||
} | ||
|
||
type encodingStartingAnchorRoot struct { | ||
GameType uint32 | ||
OutputRoot struct { | ||
Root common.Hash | ||
L2BlockNumber *big.Int | ||
} | ||
} | ||
|
||
func EncodeStartingAnchorRoots(roots []StartingAnchorRoot) ([]byte, error) { | ||
args := make([]encodingStartingAnchorRoot, len(roots)) | ||
for i, root := range roots { | ||
args[i] = encodingStartingAnchorRoot{ | ||
GameType: root.GameType, | ||
OutputRoot: struct { | ||
Root common.Hash | ||
L2BlockNumber *big.Int | ||
}{ | ||
Root: root.Root, | ||
L2BlockNumber: root.L2BlockNumber, | ||
}, | ||
} | ||
} | ||
encoded, err := anchorRootFunc.EncodeArgs(args) | ||
if err != nil { | ||
return nil, fmt.Errorf("error encoding anchor roots: %w", err) | ||
} | ||
// Chop off the function selector since w3 can't serialize structs directly | ||
return encoded[4:], nil | ||
} |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package opcm | ||
|
||
import ( | ||
"math/big" | ||
"testing" | ||
|
||
"github.com/ethereum/go-ethereum/common" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestEncodeStartingAnchorRoots(t *testing.T) { | ||
encoded, err := EncodeStartingAnchorRoots([]StartingAnchorRoot{ | ||
DefaultStartingAnchorRoot, | ||
}) | ||
require.NoError(t, err) | ||
require.EqualValues(t, PermissionedGameStartingAnchorRoots, encoded) | ||
|
||
encoded, err = EncodeStartingAnchorRoots([]StartingAnchorRoot{ | ||
{ | ||
GameType: 0, | ||
L2BlockNumber: common.Big0, | ||
}, | ||
{ | ||
GameType: 1, | ||
Root: common.Hash{0xde, 0xad}, | ||
L2BlockNumber: big.NewInt(0), | ||
}, | ||
}) | ||
require.NoError(t, err) | ||
require.EqualValues(t, | ||
common.Hex2Bytes( | ||
"0000000000000000000000000000000000000000000000000000000000000020"+ | ||
"0000000000000000000000000000000000000000000000000000000000000002"+ | ||
"0000000000000000000000000000000000000000000000000000000000000000"+ | ||
"0000000000000000000000000000000000000000000000000000000000000000"+ | ||
"0000000000000000000000000000000000000000000000000000000000000000"+ | ||
"0000000000000000000000000000000000000000000000000000000000000001"+ | ||
"dead000000000000000000000000000000000000000000000000000000000000"+ | ||
"0000000000000000000000000000000000000000000000000000000000000000"), | ||
encoded, | ||
) | ||
} |
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
Oops, something went wrong.