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

fix(taiko-client): make sure the length of txLists is not bigger than the maxBlocksPerBatch. #18855

Merged
merged 2 commits into from
Feb 1, 2025

Conversation

mask-pp
Copy link
Contributor

@mask-pp mask-pp commented Jan 31, 2025

No description provided.

@mask-pp mask-pp requested a review from davidtaikocha January 31, 2025 09:18
@mask-pp mask-pp changed the title fix(taiko-client): Make sure the length of txLists is not bigger than the maxBlocksPerBatch. fix(taiko-client): make sure the length of txLists is not bigger than the maxBlocksPerBatch. Jan 31, 2025
if err := p.ProposeTxListPacaya(ctx, txLists); err != nil {
return err
// Make sure the tx list is not bigger than the maxBlocksPerBatch.
maxBlocksPerBatch, _ := p.protocolConfigs.MaxBlocksPerBatch()
Copy link
Member

Choose a reason for hiding this comment

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

Let's check the error here, or u don't need to make this function return an error.

Copy link
Contributor Author

@mask-pp mask-pp Feb 1, 2025

Choose a reason for hiding this comment

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

Don't need to return error, and removed.

maxBlocksPerBatch, _ := p.protocolConfigs.MaxBlocksPerBatch()
for ; len(txLists) > 0; txLists = txLists[min(maxBlocksPerBatch, len(txLists)):] {
// If the current L2 chain is after ontake fork, batch propose all L2 transactions lists.
if err := p.ProposeTxListPacaya(ctx, txLists[:min(maxBlocksPerBatch, len(txLists))]); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

We need to pass the whole txLists to ProposeTxListPacaya, let's check the count inside ProposeTxListPacaya.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added check inside the ProposeTxListPacaya .

@davidtaikocha davidtaikocha merged commit 0659f0e into pacaya_fork_client Feb 1, 2025
6 checks passed
@davidtaikocha davidtaikocha deleted the fix_pacaya_fork_client_ branch February 1, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants