Skip to content

op-batcher: fix channel duration timeout management#12916

Merged
sebastianst merged 2 commits intodevelopfrom
gk/fix-channel-duaration-da-bug
Nov 18, 2024
Merged

op-batcher: fix channel duration timeout management#12916
sebastianst merged 2 commits intodevelopfrom
gk/fix-channel-duaration-da-bug

Conversation

@geoknee
Copy link
Contributor

@geoknee geoknee commented Nov 13, 2024

Description

Moves the update of channel duration timeout start point to channel submission time instead of channel closing time.

Tests

A regression unit test for this situation has been added.

Additional context
Previously, we would use L1 data to help track channel durations. For example, the batcher would be configured to post data every hour. We update a global state variable with the latest l1 origin of a channel when it closed, and compute the deadline for that channel using a duration delta starting at that l1 origin timestamp.

Since we changed the way autoDA switching works, a channel can be closed (due to a duration timeout or other reason) and this will cause the l1 origin state variable to move forward, extending the deadline ready for the next channel. Crucially, with autoDA switching nowadays, the closed channel will not always be submitted on chain (it can be discarded and the blocks requeued). If it is discarded, the channel duration timeout has already been extended.

The fix for this is to update the global state variable at channel submission time, not channel closing time.

Metadata

#12827

Previously, we would use L1 data to help track channel durations. For example, the batcher would be configured to post data every hour. We update a global state variable with the latest l1 origin of a channel when it closed, and compute the deadline for that channel using a duration delta starting at that l1 origin timestamp.

Since we changed the way autoDA switching works, a channel can be _closed_ (due to a duration timeout or other reason) and this will cause the l1 origin state variable to move forward, extending the deadline ready for the next channel. Crucially, with autoDA switching nowadays, the closed channel will not always be submitted on chain (it can be discarded and the blocks requeued). If it is discarded, the channel duration timeout has already been extended.

The fix for this is to update the global state variable at channel submission time, not channel closing time.
@geoknee geoknee added the A-op-batcher Area: op-batcher label Nov 13, 2024
@geoknee geoknee requested review from a team as code owners November 13, 2024 13:54
@geoknee geoknee requested a review from bitwiseguy November 13, 2024 13:54
@sebastianst sebastianst added this pull request to the merge queue Nov 18, 2024
Merged via the queue into develop with commit 873b3e0 Nov 18, 2024
@sebastianst sebastianst deleted the gk/fix-channel-duaration-da-bug branch November 18, 2024 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-op-batcher Area: op-batcher

Projects

None yet

Development

Successfully merging this pull request may close these issues.

op-batcher: channel closed due to timeout didn't trigger posting data to the L1/DA layer

2 participants