Skip to content

batcher: Wait for DA write before shutdown#14654

Merged
geoknee merged 1 commit intoethereum-optimism:developfrom
celo-org:karlb/batcher-wait-for-da
Apr 2, 2025
Merged

batcher: Wait for DA write before shutdown#14654
geoknee merged 1 commit intoethereum-optimism:developfrom
celo-org:karlb/batcher-wait-for-da

Conversation

@karlb
Copy link
Copy Markdown
Contributor

@karlb karlb commented Mar 5, 2025

If we don't wait for daGroup, new txs might be added after txQueue.Wait(), which would cause writes to a closed receiptsCh.

I stumbled across this because it made https://github.com/celo-org/optimism/blob/celo-rebase-12/op-e2e/system/altda/failover_test.go fail.

@karlb karlb requested review from a team and geoknee March 5, 2025 17:28
@geoknee geoknee self-assigned this Mar 6, 2025
@geoknee geoknee added the A-op-batcher Area: op-batcher label Mar 6, 2025
@geoknee
Copy link
Copy Markdown
Contributor

geoknee commented Mar 6, 2025

/ci authorize 7e0f789

@opgitgovernance opgitgovernance added the S-stale Status: Will be closed unless there is activity label Mar 20, 2025
@opgitgovernance
Copy link
Copy Markdown
Contributor

This pr has been automatically marked as stale and will be closed in 5 days if no updates

Copy link
Copy Markdown
Contributor

@geoknee geoknee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Is it feasible to write a test for this?

Out of scope for this PR, but curious on your thoughts about:

  1. Could the MaxConcurrentDARequests be effectively controlled by MaxPendingTransactions? Does it need to be a separate config var?

  2. I wonder if there's a neater way of arranging things, so that we don't need to thread daGroup through so many functions in the call stack.

@karlb
Copy link
Copy Markdown
Contributor Author

karlb commented Apr 2, 2025

Could the MaxConcurrentDARequests be effectively controlled by MaxPendingTransactions? Does it need to be a separate config var?

I didn't look thoroughly at this, but I would say that these are similar settings but there is no strict relationship between them. So while setting MaxConcurrentDARequests to MaxPendingTransactions will usually do no harm, there might be cases where this should be set differently ("Our DA layer works best when writes come in sequentially").

I wonder if there's a neater way of arranging things, so that we don't need to thread daGroup through so many functions in the call stack.

I think there are better ways to structure this, but not without larger changes to the way the batcher works. IIRC @samlaf had a good idea how the batcher could be structured to make the flow more straightforward.

@geoknee geoknee added this pull request to the merge queue Apr 2, 2025
Merged via the queue into ethereum-optimism:develop with commit 719c9b4 Apr 2, 2025
1 check passed
@samlaf
Copy link
Copy Markdown
Contributor

samlaf commented Apr 2, 2025

@karlb good find. To be sure you haven't cherry-picked/rebased on top of 23958b1#diff-c734d1296b2fd691221b92df3edf09c7533c507a74c2316117745c75c3ad5776 right?

To fix the holocene strict ordering bug in upstream batcher, I decoupled DA submission from tx submission. After receiving a DA cert, instead of sending it directly to L1, it is cached in its respective channel, such that the driver loop can pull the certs out in order and submit them to L1 with the correct nonces.

I wonder if your change would still be needed in that case. Not super sure whether the tx would still be submitted in the same driver loop or not...

@karlb
Copy link
Copy Markdown
Contributor Author

karlb commented Apr 2, 2025

To be sure you haven't cherry-picked/rebased on top of 23958b1#diff-c734d1296b2fd691221b92df3edf09c7533c507a74c2316117745c75c3ad5776 right?

@samlaf Confirmed, I didn't.

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 S-stale Status: Will be closed unless there is activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants