ethereum-optimism / optimism

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

Holocene-D: Action Tests #12449

Open sebastianst opened 1 month ago

geoknee commented 1 month ago

Things we would like from action testing:

Coverage we would like for the Holocene derivation:

geoknee commented 1 month ago

Also partial span batch validity should be tested.

The order of the batches should be correct, but midway through there should be an invalid batch.

We can have an invalid batch (make the parent hash wrong, or timestamp is incorrect https://github.com/ethereum-optimism/optimism/blob/13839ef701672a6965f1a34bd538af8008adbc9a/op-node/rollup/derive/batches.go#L34-L35) or a batch which results in an invalid payload. For an invalid payload (running out of gas or incorrect / reused nonce), the Holocene DP will generate an empty payload / deposit only block.

Pre holocene, the entire span batch becomes invalid.

We should concentrate on invalidation modes that changed in Holocene.

Post holocene,

geoknee commented 1 month ago

We should be ready soon to run the Holocene assertions. We can stub them out until we are ready.

geoknee commented 1 month ago

We also need to write tests to cover the Holocene activation itself (special case where things are reset).

We could submit the first frame (and ingest it) of a channel before the activation time, then submit the final frame after the activation. With Holocene we expect such a channel to be dropped / not derived from.

sebastianst commented 1 month ago

We should also test the new channel size limit (https://github.com/ethereum-optimism/specs/pull/431).

geoknee commented 1 week ago

Reopening to track some more coverage we would like to add.

From @clabby: Some other tests that would be great to follow up on:

geoknee commented 3 days ago

On the channel size limit. So far I have been able to write a test which constructs a >100MB channel, which with compression ON we can get on chain and trigger the expected behaviours (which are the same pre and post holocene). However it is quite a heavy / slow test (takes 28s on my laptop).

Furthermore, to test the different behaviour with Holocene we actually need a channel which is >100MB when compressed. I can create such a channel in my test by turning compression OFF -- but it is not possible to get the channel on chain with the current DA capacity. It will always time out and be rejected for that reason.

It might be possible to use alt-DA to do this, but I hesitate to go down that path (using a beta feature to test a core consensus rule).

Image

geoknee commented 2 days ago

One way forward is to define a custom test chain specification which lowers the MAX_RLP_BYTES_PER_CHANNEL parameter to something very low (e.g. 10KB). The test can then run very quickly and avoid channel timeout and L1 DA limits. But, we would need to do that for op-program and kona.

It is worth noting that we already have unit test coverage for the Go implementation for this test scenario https://github.com/ethereum-optimism/optimism/blob/38ee0891bab0c5c6607354eb3479d8597b808f4f/op-node/rollup/derive/channel_assembler_test.go#L95-L103