Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

op-batcher: fix channel duration timeout management #12916

Merged
merged 2 commits into from
Nov 18, 2024

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
49 checks passed
@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