Skip to content

Conversation

@pmikolajczyk41
Copy link
Member

@pmikolajczyk41 pmikolajczyk41 commented Nov 3, 2025

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.ChainConfig struct. 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:

  1. Batch posting: we use it to know when to stop appending data to the batch. This PR extends BatchPosterOpts and BatchPoster structs.
  2. Inbox reading: we use it to allocate enough space before decompressing sequencer message. This PR adds a new argument to the ParseSequencerMessage.

Related changes:

  • extend configs in arbitrum_chain_info.json‎ with the default value of 16MB
  • use ArbitrumDevTestChainConfig in inbox fuzzing tests
  • adapt function signatures for MEL
  • extend MessageExtractor with 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

@github-actions
Copy link

github-actions bot commented Nov 3, 2025

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
2185 4 2181 0
View the top 3 failed tests by shortest run time
TestMultiGasConstraintsStorage
Stack Traces | 0.000s run time
=== RUN   TestMultiGasConstraintsStorage
=== PAUSE TestMultiGasConstraintsStorage
=== CONT  TestMultiGasConstraintsStorage
    constraints_test.go:377: 
        	Error Trace:	/home/runner/work/nitro/nitro/precompiles/constraints_test.go:377
        	Error:      	Not equal: 
        	            	expected: 0x1
        	            	actual  : 0x3
        	Test:       	TestMultiGasConstraintsStorage
--- FAIL: TestMultiGasConstraintsStorage (0.00s)
TestValidationInputsAtWithWasmTarget
Stack Traces | 2.300s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
        github.com/offchainlabs/nitro/util/testhelpers.RequireImpl({0x40eff10, 0xc0cdd9e380}, {0x40ad1e0, 0xc0c63ad220}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/util/testhelpers/testhelpers.go:29 +0x55
        github.com/offchainlabs/nitro/system_tests.Require(0xc0cdd9e380, {0x40ad1e0, 0xc0c63ad220}, {0x0, 0x0, 0x0})
        	/home/runner/work/nitro/nitro/system_tests/common_test.go:1901 +0x5d
        github.com/offchainlabs/nitro/system_tests.TestValidationInputsAtWithWasmTarget(0xc0cdd9e380)
        	/home/runner/work/nitro/nitro/system_tests/validation_inputs_at_test.go:70 +0x970
        testing.tRunner(0xc0cdd9e380, 0x3d2fb50)
        	/opt/hostedtoolcache/go/1.25.4/x64/src/testing/testing.go:1934 +0xea
        created by testing.(*T).Run in goroutine 1
        	/opt/hostedtoolcache/go/1.25.4/x64/src/testing/testing.go:1997 +0x465
        
    validation_inputs_at_test.go:70: �[31;1m [] failed calculating position for validation: batch not found on L1 yet �[0;0m
�[90mTime to activate read-return-data: 210.380617ms�[0;0m
�[90mread-return-data.evm 0xA02062aa4Cb0872315ACA3eA6dBF077d90B2DAC1�[0;0m
�[34;1mchecking calls with partial return data�[0;0m
�[90mTime to activate storage: 194.248171ms�[0;0m
�[90mTime to activate log: 169.328375ms�[0;0m
�[90mmulticall: len 5.31K vs 12.50K�[0;0m
�[90mmulticall: deployed to 0x4d283c85f09562f31fD635abC5261A670461e13E�[0;0m
--- FAIL: TestValidationInputsAtWithWasmTarget (2.30s)
TestBatchSizeLimitIsConfigurable
Stack Traces | 23.540s run time
... [CONTENT TRUNCATED: Keeping last 20 lines]
TRACE[12-08|16:46:33.045] P2P networking is spinning down
TRACE[12-08|16:46:33.045] Handled RPC response                     reqid=1442  duration="2.144µs"
DEBUG[12-08|16:46:33.046] Served eth_estimateGas                   reqid=1439  duration=2.063484ms
DEBUG[12-08|16:46:33.046] Served eth_getTransactionReceipt         reqid=15    duration="296.873µs"
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=1439  duration="1.713µs"
DEBUG[12-08|16:46:33.046] Served eth_subscribe                     reqid=16    duration="27.902µs"
DEBUG[12-08|16:46:33.046] Begin checking the correctness of batch against inbox multiplexer startMsgSeqNum=2   endMsgSeqNum=2
DEBUG[12-08|16:46:33.046] Executing EVM call finished              runtime="344.993µs"
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=15    duration="2.174µs"
DEBUG[12-08|16:46:33.046] Served eth_getBlockByNumber              reqid=1032  duration="112.119µs"
DEBUG[12-08|16:46:33.046] Served eth_getBlockByNumber              reqid=1387  duration="114.023µs"
DEBUG[12-08|16:46:33.046] Served eth_getBlockByNumber              reqid=1165  duration="96.95µs"
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=1032  duration="1.323µs"
DEBUG[12-08|16:46:33.046] Served eth_call                          reqid=1443  duration="660.86µs"
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=1165  duration="1.022µs"
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=1443  duration="1.523µs"
DEBUG[12-08|16:46:33.046] Expecting to find sequencer batches      checkingBatchCount=2  ourLatestBatchCount=1  currentHeight=36
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=1387  duration="2.074µs"
TRACE[12-08|16:46:33.046] Handled RPC response                     reqid=16    duration="4.278µs"
--- FAIL: TestBatchSizeLimitIsConfigurable (23.54s)

📣 Thoughts on this report? Let Codecov know! | Powered by Codecov

Copy link
Member

@Tristan-Wilson Tristan-Wilson left a 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.

Tristan-Wilson
Tristan-Wilson previously approved these changes Nov 12, 2025
Copy link
Contributor

@tsahee tsahee left a 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

@tsahee tsahee removed their assignment Dec 5, 2025
…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()) {
Copy link
Contributor

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


// 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)
Copy link
Contributor

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?

// It's not safe to trust any part of the payload from this point onwards.
var uncompressedBatchSizeLimit uint64
if chainConfig != nil {
uncompressedBatchSizeLimit = chainConfig.MaxUncompressedBatchSize()
Copy link
Contributor

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)

@tsahee tsahee assigned pmikolajczyk41 and unassigned tsahee Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants