Skip to content

Commit

Permalink
Address CR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
natebeauregard committed Dec 16, 2024
1 parent 9ede6c1 commit 73f5f8d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/docs/build/create-an-app-with-monomer.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/build/interact.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<address>"
./testappd monomer start --minimum-gas-prices 0.01wei --monomer.sequencer --monomer.dev-start --api.enable --monomer.dev.l1-user-address "<address>"
```

## Configuring L1 and L2 Wallets
Expand Down
2 changes: 1 addition & 1 deletion e2e/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func Run(
"monomer",
"start",
"--minimum-gas-prices", "0.001wei",
"--monomer.sequencer-mode",
"--monomer.sequencer",
"--monomer.dev-start",
))
appCmd.Dir = appDirPath
Expand Down
2 changes: 1 addition & 1 deletion integrations/integrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
27 changes: 13 additions & 14 deletions opdevnet/opdevnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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)
Expand Down Expand Up @@ -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,
Expand All @@ -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.
Expand Down

0 comments on commit 73f5f8d

Please sign in to comment.