-
Notifications
You must be signed in to change notification settings - Fork 683
[NIT-3121] Make uncompressed batch size limit configurable #3947
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
base: master
Are you sure you want to change the base?
[NIT-3121] Make uncompressed batch size limit configurable #3947
Conversation
❌ 4 Tests Failed:
View the top 3 failed tests by shortest run time
📣 Thoughts on this report? Let Codecov know! | Powered by Codecov |
Tristan-Wilson
left a comment
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.
PR looks good but I had a comment on the geth PR which will probably change this one due to how to access the new decompression limit setting, so marking request changes.
…-uncompressed-batch-size-limit
tsahee
left a comment
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.
sorry for the long delay. generally seems great
…ajczyk/nit-3121-uncompressed-batch-size-limit # Conflicts: # arbnode/batch_poster.go # arbnode/mel/extraction/message_extraction_function.go # arbnode/mel/extraction/message_extraction_function_test.go # arbnode/node.go # arbstate/inbox.go # cmd/chaininfo/arbitrum_chain_info.json # cmd/replay/main.go # go-ethereum # system_tests/eth_config_test.go
| // setup initializes a test node with the option to set a higher uncompressed batch size limit. | ||
| // Also, it creates genesis accounts for sender and receiver with appropriate balances. | ||
| // It returns the NodeBuilder and a cleanup function to be called after the test. | ||
| func setUp(t *testing.T, setHighLimit bool) (*NodeBuilder, context.Context, func()) { |
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.
setup is a bad name for a function in system_tests package :) give it a more specific name
system_tests/batch_poster_test.go
Outdated
|
|
||
| // Increase the max batch size to allow posting and restart the L2 node to apply the change. | ||
| builder.chainConfig.ArbitrumChainParams.MaxUncompressedBatchSize = 100_000 | ||
| builder.RestartL2Node(t) |
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.
TBH I'm kind of disappointed that the test is passing since here I'd be happy if the node refuses to load with a chainConfig that's different from the original one that it had.
Does this test add a lot?
arbstate/inbox.go
Outdated
| // It's not safe to trust any part of the payload from this point onwards. | ||
| var uncompressedBatchSizeLimit uint64 | ||
| if chainConfig != nil { | ||
| uncompressedBatchSizeLimit = chainConfig.MaxUncompressedBatchSize() |
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.
I went back-and-forth on it, but I think I landed on the side of:
We should make it arbos-version dependant, so:
- MaxUncompressedBatchSize should accept arbosVersion as parameter
- should only use non-default size if arbos-version is > (some new constant like arbosVersion_BatchSize that'll be initially set to 52)
We extend (Arbitrum) chain config with a new field describing limit on the uncompressed batch size (previously hardcoded to 16MB).
Note
Design decision: Instead of propagating individual limit values as bare integers between components, we pass the entire
params.ChainConfigstruct. This architectural decision is crucial for maintaining chain configuration integrity. By requiring access to the specific limit field only via the full parameters object, we explicitly guarantee that the value used is always sourced directly from the authoritative chain configuration. This mitigates the risk of developers accidentally (or intentionally) passing arbitrary values that are incompatible with the chain's agreed-upon settings.This limit value is used in two places:
BatchPosterOptsandBatchPosterstructs.ParseSequencerMessage.Related changes:
arbitrum_chain_info.jsonwith the default value of 16MBArbitrumDevTestChainConfigin inbox fuzzing testsMessageExtractorwith chain params (I preferred to do this instead of extending MEL state as suggested in the Linear ticket)companion PR: OffchainLabs/go-ethereum#571
solves NIT-3121