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

feat: check channel timed out before data submission #27

Conversation

bendanzhentan
Copy link
Contributor

@bendanzhentan bendanzhentan commented Aug 16, 2023

Specification

Previously, Batcher would check the channel timeout after confirming a transaction.

Now this PR also checks the channel timeout before sending a transaction.

If there are pending channel frames that have not yet been submitted and the current l1Head exceeds the channel timeout, it is advisable to cancel the pending channel to prevent unnecessary submission.

By canceling the pending channel, its blocks will be re-pushed back to the pending blocks queue. And later, the Batcher will make attempt to construct a new channel.

Rational

Check channel timeout before sending transactions to reduce the probability of on-chain channel timeout.

Context for reproducing issue

  1. Construct a multi-frames channel.
  2. Submit certain frames of this channel.
  3. Batcher has insufficient balance for the submission of the remaining frames.
  4. wait(channel_timeout)
  5. Fund some balance to Batcher. Batcher re-submits the remaining frames.
  6. On-chain channel timeout occurs

Review suggestion

This additional check is not required if we can guarantee sufficient balance

The probability is very low.

My personal opinion would be to close this PR.

@bendanzhentan bendanzhentan force-pushed the release/testnet-check-channel-timed-out-before-data-submission branch 3 times, most recently from dfee342 to 03750d4 Compare August 17, 2023 01:37
@bendanzhentan bendanzhentan force-pushed the release/testnet-check-channel-timed-out-before-data-submission branch from 03750d4 to e070889 Compare August 17, 2023 06:25
@github-actions
Copy link
Contributor

github-actions bot commented Sep 1, 2023

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants