op-batcher: Move decision about data availability type to channel submission time #12002
+98
−20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #11609
For now, I decided to not make any changes to the decision logic itself (only to when it is triggered and what happens when a change is necessary).
Changing the trigger for the decision opens the opportunity to make a more accurate decision about which DA type to choose, since some transaction data is now in scope. However, this would not address the larger assumption in the current logic, which is about how many blobs are typically included in a tx. This can be lower than the target number on chains with low throughput as channels must be closed before they time out. To address this assumption, we could store the previous number of blobs per tx to make a better estimate than the current one (which assumes we always include the target number). This is saved for future work.
Tests: the modified implementation passes existing tests, including an end to end test for switching DA type.