kona icon indicating copy to clipboard operation
kona copied to clipboard

fix(client): Respect channel timeout

Open clabby opened this issue 1 year ago • 1 comments

Overview

Currently, we don't respect the channel timeout in kona-client. This change will be a painful one to make for performance, but we need to respect consensus rules rather than batcher policy.

In real-world application, the OP Stack batcher almost always opens and closes channels in a single transaction. However, this is strictly not guaranteed by the protocol.

To accommodate for this, we must start derivation at least RollupConfig::channel_timeout blocks before the L1 origin of the trusted safe head.

https://github.com/ethereum-optimism/kona/blob/e069eb4178af1a2a7ea1f772f3f35c240d178534/bin/client/src/l1/driver.rs#L203-L203

clabby avatar Aug 05 '24 21:08 clabby

Discussed offline: attempt to derive the channel in the happy path from the l1 origin. If it fails to derive the channel, walk back the channel timeout window of L1 blocks.

refcell avatar Aug 11 '24 21:08 refcell