-
Notifications
You must be signed in to change notification settings - Fork 619
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(relayer): adapt to CodecV7 for EuclidV2 #1583
base: omerfirmak/mpt
Are you sure you want to change the base?
Conversation
…submit multiple batches in a single transaction
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…ntextID logic to support multiple batches by concatenating batch hashes
return | ||
} | ||
|
||
dbParentBatch, err = r.batchOrm.GetBatchByIndex(r.ctx, dbBatch.Index-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these batches are already in memory (dbBatches
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to use dbBatches
except for i==0
in 5a479c3
|
||
r.metrics.rollupL2RelayerCommitBlockHeight.Set(float64(maxBlockHeight)) | ||
r.metrics.rollupL2RelayerCommitThroughput.Add(float64(totalGasUsed)) | ||
r.metrics.rollupL2RelayerProcessPendingBatchSuccessTotal.Add(float64(len(batchesToSubmit))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also want to monitor the time series of len(batchesToSubmit)
(to see average submission).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 5a479c3
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## omerfirmak/mpt #1583 +/- ##
=================================================
Coverage ? 42.09%
=================================================
Files ? 221
Lines ? 17713
Branches ? 0
=================================================
Hits ? 7457
Misses ? 9563
Partials ? 693
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f277483
to
e324f2a
Compare
e324f2a
to
f4e17bc
Compare
@@ -378,11 +378,194 @@ func (r *Layer2Relayer) ProcessGasPriceOracle() { | |||
// ProcessPendingBatches processes the pending batches by sending commitBatch transactions to layer 1. | |||
func (r *Layer2Relayer) ProcessPendingBatches() { | |||
// get pending batches from database in ascending order by their index. | |||
dbBatches, err := r.batchOrm.GetFailedAndPendingBatches(r.ctx, 5) | |||
dbBatches, err := r.batchOrm.GetFailedAndPendingBatches(r.ctx, max(5, r.cfg.SenderConfig.BatchSubmission.MaxBatches)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we remove 5, and use config value only?
// TODO: this needs to be updated once the contract interface is finalized | ||
calldata, err := r.l1RollupABI.Pack("commitBatches", version, firstParentBatch.BatchHeader) | ||
if err != nil { | ||
return nil, nil, 0, 0, fmt.Errorf("failed to pack commitBatchWithBlobProof: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return nil, nil, 0, 0, fmt.Errorf("failed to pack commitBatchWithBlobProof: %w", err) | |
return nil, nil, 0, 0, fmt.Errorf("failed to pack commitBatches: %w", err) |
Purpose or design rationale of this PR
This PR implements changes according to
CodecV7
forEuclidV2
. Depends on scroll-tech/da-codec#33CodecV7
min
andmax
batches in combination withtimeout
PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
Deployment tag versioning
Has
tag
incommon/version.go
been updated or have you addedbump-version
label to this PR?Breaking change label
Does this PR have the
breaking-change
label?