diff --git a/docs/docs/build/create-an-app-with-monomer.md b/docs/docs/build/create-an-app-with-monomer.md index 967ddbfe..b825fd5f 100644 --- a/docs/docs/build/create-an-app-with-monomer.md +++ b/docs/docs/build/create-an-app-with-monomer.md @@ -48,10 +48,10 @@ go build -ldflags=-checklinkname=0 -o testappd ./cmd/testappd Now that our application is configured, we can start the Monomer application in sequencer mode by running the following command. ```bash -./testappd monomer start --minimum-gas-prices 0.01wei --monomer.sequencer-mode --monomer.dev-start --api.enable +./testappd monomer start --minimum-gas-prices 0.01wei --monomer.sequencer --monomer.dev-start --api.enable ```` -To run the application in verifier mode, omit the `--monomer.sequencer-mode` flag: +To run the application in verifier mode, omit the `--monomer.sequencer` flag: ```bash ./testappd monomer start --minimum-gas-prices 0.01wei --monomer.dev-start --api.enable diff --git a/docs/docs/build/interact.md b/docs/docs/build/interact.md index ef72bde7..93f4edf3 100644 --- a/docs/docs/build/interact.md +++ b/docs/docs/build/interact.md @@ -10,7 +10,7 @@ We will need to have an account on L1 with funds. To give yourself funds on the devnet at genesis, run the devnet start command specified in the last tutorial with the `--monomer.dev.l1-user-address` flag: ```bash -./testappd monomer start --minimum-gas-prices 0.01wei --monomer.sequencer-mode --monomer.dev-start --api.enable --monomer.dev.l1-user-address "
" +./testappd monomer start --minimum-gas-prices 0.01wei --monomer.sequencer --monomer.dev-start --api.enable --monomer.dev.l1-user-address "
" ``` ## Configuring L1 and L2 Wallets diff --git a/e2e/e2e.go b/e2e/e2e.go index d8a819af..1e2641ee 100644 --- a/e2e/e2e.go +++ b/e2e/e2e.go @@ -71,7 +71,7 @@ func Run( "monomer", "start", "--minimum-gas-prices", "0.001wei", - "--monomer.sequencer-mode", + "--monomer.sequencer", "--monomer.dev-start", )) appCmd.Dir = appDirPath diff --git a/integrations/integrations.go b/integrations/integrations.go index aecad54a..0a2bb7fe 100644 --- a/integrations/integrations.go +++ b/integrations/integrations.go @@ -54,7 +54,7 @@ import ( const ( flagEngineURL = "monomer.engine-url" - flagSequencerMode = "monomer.sequencer-mode" + flagSequencerMode = "monomer.sequencer" flagDev = "monomer.dev-start" flagL1AllocsPath = "monomer.dev.l1-allocs" flagL1DeploymentsPath = "monomer.dev.l1-deployments" diff --git a/opdevnet/opdevnet_test.go b/opdevnet/opdevnet_test.go index d7dceb5b..da81395d 100644 --- a/opdevnet/opdevnet_test.go +++ b/opdevnet/opdevnet_test.go @@ -78,14 +78,15 @@ func TestOPDevnet(t *testing.T) { l1Config.BlobsDirPath = t.TempDir() require.NoError(t, l1Config.Run(ctx, env, log.NewLogger(log.NewTerminalHandler(openLogFile(t, env, "l1"), false)))) l1GenesisBlock := l1Config.Genesis.ToBlock() - l1URL.IsReachable(ctx) + require.True(t, l1URL.IsReachable(ctx)) l2Allocs, err := opdevnet.DefaultL2Allocs() require.NoError(t, err) l2Genesis, err := genesis.BuildL2Genesis(deployConfig, l2Allocs, l1GenesisBlock) require.NoError(t, err) - jwtSecret := [32]byte{123} + + // Set up and run a sequencer node l2Node, l2Backend, err := geth.InitL2("l2", l2Genesis.Config.ChainID, l2Genesis, writeJWT(t, jwtSecret), func(_ *ethconfig.Config, nodeCfg *node.Config) error { nodeCfg.AuthAddr = l2EngineURL.Hostname() nodeCfg.AuthPort = int(l2EngineURL.PortU16()) @@ -98,7 +99,7 @@ func TestOPDevnet(t *testing.T) { defer func() { require.NoError(t, l2Node.Close()) }() - l2EngineURL.IsReachable(ctx) + require.True(t, l2EngineURL.IsReachable(ctx)) secrets, err := opdevnet.DefaultMnemonicConfig.Secrets() require.NoError(t, err) @@ -156,7 +157,7 @@ func TestOPDevnet(t *testing.T) { defer func() { require.NoError(t, verifierL2Node.Close()) }() - l2EngineURL.IsReachable(ctx) + require.True(t, verifierL2EngineURL.IsReachable(ctx)) verifierOpConfig, err := opdevnet.BuildOPConfig( deployConfig, @@ -176,19 +177,17 @@ func TestOPDevnet(t *testing.T) { require.NoError(t, verifierOpConfig.Run(ctx, env, log.NewLogger(log.NewTerminalHandler(openLogFile(t, env, "op-verifier"), false)))) // Wait for the verifier node to sync to block 10 - for i := 0; i < 30; i++ { - verifierBlockNum := verifierL2Backend.BlockChain().CurrentHeader().Number - if verifierBlockNum.Uint64() >= 10 { + const waitBlocks = 30 + for i := 0; i < waitBlocks; i++ { + if verifierL2Backend.BlockChain().CurrentHeader().Number.Uint64() >= 10 { + // Assert that the verifier and sequencer state roots at block 10 are equal + require.Equal(t, verifierL2Backend.BlockChain().GetHeaderByNumber(10).Root, l2Backend.BlockChain().GetHeaderByNumber(10).Root) break + } else if i == waitBlocks-1 { + t.Fatalf("verifier only synced to block %v", verifierL2Backend.BlockChain().CurrentHeader().Number) } - if i == 29 { - t.Fatalf("Verifier failed to sync to block 10. Current block: %v", verifierBlockNum) - } - time.Sleep(time.Second) + time.Sleep(time.Second * time.Duration(l1Config.BlockTime)) } - - // Assert that the verifier and sequencer state roots at block 10 are equal - require.Equal(t, verifierL2Backend.BlockChain().GetHeaderByNumber(10).Root, l2Backend.BlockChain().GetHeaderByNumber(10).Root) } // Copied and slightly modified from optimism/op-e2e.