ethereum-optimism / optimism

Optimism is Ethereum, scaled.
https://optimism.io
MIT License
5.65k stars 3.28k forks source link

batch-decoder: doesn't work on devnet #11506

Open samlaf opened 3 months ago

samlaf commented 3 months ago

Bug Description

Can't use the batch decoding cli tool on devnet.

Steps to Reproduce

Starting the devnet and running

cd op-node/cmd/batch_decoder
go run . fetch --start 0 --end 50 --inbox 0xff00000000000000000000000000000000000901 --sender 0x3c44cdddb6a900fa2b585dd299e03d12fa4293bc --l1 http://localhost:8545
go run . reassemble --inbox 0xff00000000000000000000000000000000000901

runs without errors, but actually doesn't produce any files in /tmp/batch_decoder/channel_cache.

This is because the --inbox flag for the reassemble subcommand is overwritten here.

That code is only ran when https://github.com/ethereum-optimism/optimism/blob/f243ad0d892dfa9dc022caeb0155c0c9ff5fef52/op-node/cmd/batch_decoder/main.go#L161 returns a nil error, so I tried passing a random chainid:

go run . reassemble --inbox 0xff00000000000000000000000000000000000901 --l2-chain-id 101

but this panics.

Expected behavior The command reassemble command should work like the fetch one on devnet, and ideally print the directory as output and mention if no file was written. Right now it just silently returns and is very tricky to use (I had to run it with --help to figure out what it's supposed to do, and which dir its supposed to write to, then figure out there was a bug, etc.)

Environment Information: Running on macos, but this is not important.

Configurations: Command line flags or environment variables you're using.

Logs: Logs and/or error messages that help illustrate the issue.

Additional context Add any other context about the problem here.


⚠️ Notice: Issues that do not include the following sections will be subject to closure:

Please ensure all required sections are filled out accurately to expedite the debugging process and improve issue resolution efficiency.

tynes commented 3 months ago

You should be able to pass in the arguments that would otherwise be autofilled by loading the config. These arguments should act as overrides compared to values sourced from the config. Good find!