diff --git a/params/config_arbitrum.go b/params/config_arbitrum.go index 7d48621d1e..244bcf66a3 100644 --- a/params/config_arbitrum.go +++ b/params/config_arbitrum.go @@ -51,6 +51,8 @@ const MaxDebugArbosVersionSupported = ArbosVersion_51 const ArbosVersion_Dia = ArbosVersion_50 const ArbosVersion_MultiConstraintFix = ArbosVersion_51 +const DefaultMaxL2MessageSize = 256 * 1024 + type ArbitrumChainParams struct { EnableArbOS bool AllowDebugPrecompiles bool @@ -58,8 +60,9 @@ type ArbitrumChainParams struct { InitialArbOSVersion uint64 InitialChainOwner common.Address 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 + 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 + MaxL2MessageSize uint64 `json:"MaxL2MessageSize,omitempty"` // Maximum size of L2 message. 0 value implies DefaultMaxL2MessageSize } func (c *ChainConfig) IsArbitrum() bool { @@ -88,6 +91,13 @@ func (c *ChainConfig) DebugMode() bool { return c.ArbitrumChainParams.AllowDebugPrecompiles } +func (c *ChainConfig) MaxL2MessageSize() uint64 { + if c.ArbitrumChainParams.MaxL2MessageSize == 0 { + return DefaultMaxL2MessageSize + } + return c.ArbitrumChainParams.MaxL2MessageSize +} + 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.