Skip to content

Commit

Permalink
cannon: Fix cli --stop-at-preimage value parsing (ethereum-optimism#1…
Browse files Browse the repository at this point in the history
…2234)

* cannon: Fix cli --stop-at-preimage value parsing

* Setup alloc type in system config
  • Loading branch information
Inphi authored and samlaf committed Nov 10, 2024
1 parent a37154d commit e70d274
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cannon/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func Run(ctx *cli.Context) error {
}
stopAtPreimageKeyPrefix = common.FromHex(parts[0])
if len(parts) == 2 {
x, err := strconv.ParseUint(parts[1], 10, arch.WordSizeBytes)
x, err := strconv.ParseUint(parts[1], 10, arch.WordSize)
if err != nil {
return fmt.Errorf("invalid preimage offset: %w", err)
}
Expand Down
3 changes: 2 additions & 1 deletion op-e2e/faultproofs/cannon_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"

op_e2e "github.com/ethereum-optimism/optimism/op-e2e"
"github.com/ethereum-optimism/optimism/op-e2e/config"
"github.com/ethereum-optimism/optimism/op-e2e/system/e2esys"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
Expand All @@ -37,7 +38,7 @@ func TestBenchmarkCannon_FPP(t *testing.T) {

op_e2e.InitParallel(t, op_e2e.UsesCannon)
ctx := context.Background()
cfg := e2esys.DefaultSystemConfig(t)
cfg := e2esys.DefaultSystemConfig(t, e2esys.WithAllocType(config.AllocTypeFromEnv()))
// We don't need a verifier - just the sequencer is enough
delete(cfg.Nodes, "verifier")
// Use a small sequencer window size to avoid test timeout while waiting for empty blocks
Expand Down
3 changes: 2 additions & 1 deletion op-e2e/faultproofs/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"crypto/ecdsa"
"testing"

"github.com/ethereum-optimism/optimism/op-e2e/config"
"github.com/ethereum-optimism/optimism/op-e2e/system/e2esys"
"github.com/ethereum-optimism/optimism/op-e2e/system/helpers"

Expand Down Expand Up @@ -50,7 +51,7 @@ func WithSequencerWindowSize(size uint64) faultDisputeConfigOpts {
}

func StartFaultDisputeSystem(t *testing.T, opts ...faultDisputeConfigOpts) (*e2esys.System, *ethclient.Client) {
cfg := e2esys.DefaultSystemConfig(t)
cfg := e2esys.DefaultSystemConfig(t, e2esys.WithAllocType(config.AllocTypeFromEnv()))
delete(cfg.Nodes, "verifier")
cfg.Nodes["sequencer"].SafeDBPath = t.TempDir()
cfg.DeployConfig.SequencerWindowSize = 4
Expand Down

0 comments on commit e70d274

Please sign in to comment.