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

add check for l2batchdata limit #691

Merged

Conversation

V-Staykov
Copy link
Collaborator

No description provided.

@V-Staykov V-Staykov linked an issue Jul 2, 2024 that may be closed by this pull request
@cla-bot cla-bot bot added the cla-signed label Jul 2, 2024
Copy link

sonarcloud bot commented Jul 2, 2024

@V-Staykov V-Staykov enabled auto-merge (squash) July 2, 2024 14:53
@V-Staykov V-Staykov merged commit e2ffe0b into zkevm Jul 2, 2024
5 checks passed
@V-Staykov V-Staykov deleted the 687-sequencer-batches-too-large-to-fit-into-l1-call-data branch July 2, 2024 15:56
@@ -421,3 +422,45 @@ func checkForBadBatch(

return false, nil
}

var (
LIMIT_128_KB = uint64(128 * 1024)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we can keep this as a constant 128_000. This is the limit in the smart contract for batchL2Data rather than "real" kb


bdc.bytes = append(bdc.bytes, newBytes...)
return false
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can simplify this quite a bit and avoid some of the code calling this function. We only care about the size of the batchL2Data and we know every changeL2Block transaction is always 9 bytes so we can just keep a track of the number of blocks and append blockCount * 9 to the transaction bytes, which sadly does need to be fully calculated

bytes []byte
}

func NewBlockDataChecker() *BlockDataChecker {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe BatchDataSizeChecker rather than mentioning blocks?

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.

[Sequencer] batches too large to fit into L1 call data
3 participants