From 4565d679f5bbb80d81aa94b410879ae11055c958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Mon, 3 Nov 2025 18:25:18 +0100 Subject: [PATCH 1/4] Extend ArbitrumChainParams --- params/config_arbitrum.go | 1 + 1 file changed, 1 insertion(+) diff --git a/params/config_arbitrum.go b/params/config_arbitrum.go index 7ca6983f83..5450056154 100644 --- a/params/config_arbitrum.go +++ b/params/config_arbitrum.go @@ -57,6 +57,7 @@ type ArbitrumChainParams struct { GenesisBlockNum uint64 MaxCodeSize uint64 `json:"MaxCodeSize,omitempty"` // Maximum bytecode to permit for a contract. 0 value implies params.DefaultMaxCodeSize MaxInitCodeSize uint64 `json:"MaxInitCodeSize,omitempty"` // Maximum initcode to permit in a creation transaction and create instructions. 0 value implies params.DefaultMaxInitCodeSize + MaxUncompressedBatchSize uint64 `json:"MaxUncompressedBatchSize,omitempty"` } func (c *ChainConfig) IsArbitrum() bool { From 99f642a2d66c4ed31819e69573636b257291e2fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Mon, 10 Nov 2025 10:35:54 +0100 Subject: [PATCH 2/4] Add accessor for the limit in the config --- params/config_arbitrum.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/params/config_arbitrum.go b/params/config_arbitrum.go index 5450056154..3d0a744a22 100644 --- a/params/config_arbitrum.go +++ b/params/config_arbitrum.go @@ -48,6 +48,8 @@ const MaxArbosVersionSupported = ArbosVersion_40 const MaxDebugArbosVersionSupported = ArbosVersion_50 const ArbosVersion_Dia = ArbosVersion_50 +const DefaultMaxUncompressedBatchSize = 16 * 1024 * 1024 // 16 MB + type ArbitrumChainParams struct { EnableArbOS bool AllowDebugPrecompiles bool @@ -86,6 +88,13 @@ func (c *ChainConfig) DebugMode() bool { return c.ArbitrumChainParams.AllowDebugPrecompiles } +func (c *ChainConfig) MaxUncompressedBatchSize() uint64 { + if c.ArbitrumChainParams.MaxUncompressedBatchSize == 0 { + return DefaultMaxUncompressedBatchSize + } + return c.ArbitrumChainParams.MaxUncompressedBatchSize +} + func (c *ChainConfig) checkArbitrumCompatible(newcfg *ChainConfig, head *big.Int) *ConfigCompatError { if c.IsArbitrum() != newcfg.IsArbitrum() { // This difference applies to the entire chain, so report that the genesis block is where the difference appears. From 5a76403e74c9b4ae9eaef8fae749471e23d7c63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Tue, 9 Dec 2025 14:26:08 +0100 Subject: [PATCH 3/4] Make batch size limit arbos-version dependent --- params/config_arbitrum.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/params/config_arbitrum.go b/params/config_arbitrum.go index 242e77cf56..d219695c43 100644 --- a/params/config_arbitrum.go +++ b/params/config_arbitrum.go @@ -40,6 +40,7 @@ const ArbosVersion_40 = uint64(40) const ArbosVersion_41 = uint64(41) const ArbosVersion_50 = uint64(50) const ArbosVersion_51 = uint64(51) +const ArbosVersion_52 = uint64(52) const ArbosVersion_60 = uint64(60) const ArbosVersion_FixRedeemGas = ArbosVersion_11 @@ -50,6 +51,7 @@ const MaxArbosVersionSupported = ArbosVersion_51 const MaxDebugArbosVersionSupported = ArbosVersion_51 const ArbosVersion_Dia = ArbosVersion_50 const ArbosVersion_MultiConstraintFix = ArbosVersion_51 +const ArbosVersion_BatchSize = ArbosVersion_52 const DefaultMaxUncompressedBatchSize = 16 * 1024 * 1024 // 16 MB @@ -91,8 +93,8 @@ func (c *ChainConfig) DebugMode() bool { return c.ArbitrumChainParams.AllowDebugPrecompiles } -func (c *ChainConfig) MaxUncompressedBatchSize() uint64 { - if c.ArbitrumChainParams.MaxUncompressedBatchSize == 0 { +func (c *ChainConfig) MaxUncompressedBatchSize(arbosVersion uint64) uint64 { + if arbosVersion < ArbosVersion_BatchSize || c.ArbitrumChainParams.MaxUncompressedBatchSize == 0 { return DefaultMaxUncompressedBatchSize } return c.ArbitrumChainParams.MaxUncompressedBatchSize From 3bc2944894fa717c0be12666b87ad1d7b998374b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Wed, 10 Dec 2025 09:20:01 +0100 Subject: [PATCH 4/4] forbid changing the limit in the chain config --- params/config_arbitrum.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/params/config_arbitrum.go b/params/config_arbitrum.go index d219695c43..ebbd662f32 100644 --- a/params/config_arbitrum.go +++ b/params/config_arbitrum.go @@ -113,6 +113,9 @@ func (c *ChainConfig) checkArbitrumCompatible(newcfg *ChainConfig, head *big.Int if cArb.GenesisBlockNum != newArb.GenesisBlockNum { return newBlockCompatError("genesisblocknum", new(big.Int).SetUint64(cArb.GenesisBlockNum), new(big.Int).SetUint64(newArb.GenesisBlockNum)) } + if cArb.MaxUncompressedBatchSize != newArb.MaxUncompressedBatchSize { + return newBlockCompatError("maxuncompressedbatchsize", new(big.Int).SetUint64(cArb.MaxUncompressedBatchSize), new(big.Int).SetUint64(newArb.MaxUncompressedBatchSize)) + } return nil }