Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions op-e2e/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ func deriveAccount(w accounts.Wallet, path string) accounts.Account {

type L2OOContractConfig struct {
SubmissionFrequency *big.Int
L2StartingBlock *big.Int
GenesisL2Output [32]byte
HistoricalTotalBlocks *big.Int
L2StartingTimeStamp *big.Int
L2BlockTime *big.Int
}

type DepositContractConfig struct {
Expand Down Expand Up @@ -388,9 +384,6 @@ func (cfg SystemConfig) start() (*System, error) {
sys.cfg.RollupConfig.Genesis = sys.RolupGenesis
sys.cfg.RollupConfig.BatchSenderAddress = batchSubmitterAddr
sys.cfg.RollupConfig.P2PSequencerAddress = p2pSignerAddr
sys.cfg.L2OOCfg.L2StartingBlock = new(big.Int).SetUint64(l2GenesisID.Number)
sys.cfg.L2OOCfg.L2StartingTimeStamp = new(big.Int).SetUint64(l2Genesis.Timestamp)
sys.cfg.L2OOCfg.L2BlockTime = new(big.Int).SetUint64(2)

// Deploy Deposit Contract
deployerPrivKey, err := sys.wallet.PrivateKey(accounts.Account{
Expand All @@ -407,16 +400,21 @@ func (cfg SystemConfig) start() (*System, error) {
return nil, err
}

// empty genesis L2 output.
// Technically this may need to be computed with l2.ComputeL2OutputRoot(...),
// but there are no fraud proofs active in the test.
genesisL2Output := [32]byte{}

// Deploy contracts
sys.L2OOContractAddr, _, _, err = bindings.DeployL2OutputOracle(
opts,
l1Client,
sys.cfg.L2OOCfg.SubmissionFrequency,
sys.cfg.L2OOCfg.GenesisL2Output,
genesisL2Output,
sys.cfg.L2OOCfg.HistoricalTotalBlocks,
sys.cfg.L2OOCfg.L2StartingBlock,
sys.cfg.L2OOCfg.L2StartingTimeStamp,
sys.cfg.L2OOCfg.L2BlockTime,
new(big.Int).SetUint64(l2GenesisID.Number),
new(big.Int).SetUint64(l2Genesis.Timestamp),
new(big.Int).SetUint64(sys.cfg.RollupConfig.BlockTime),
l2OutputSubmitterAddr,
crypto.PubkeyToAddress(deployerPrivKey.PublicKey),
)
Expand Down
2 changes: 0 additions & 2 deletions op-e2e/system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ func defaultSystemConfig(t *testing.T) SystemConfig {
FinalizationPeriod: big.NewInt(60 * 60 * 24),
},
L2OOCfg: L2OOContractConfig{
// L2 Start time is set based off of the L2 Genesis time
SubmissionFrequency: big.NewInt(4),
L2BlockTime: big.NewInt(2),
HistoricalTotalBlocks: big.NewInt(0),
},
L2OutputHDPath: l2OutputHDPath,
Expand Down