Skip to content
10 changes: 10 additions & 0 deletions params/config_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const MaxDebugArbosVersionSupported = ArbosVersion_51
const ArbosVersion_Dia = ArbosVersion_50
const ArbosVersion_MultiConstraintFix = ArbosVersion_51

const DefaultMaxUncompressedBatchSize = 16 * 1024 * 1024 // 16 MB

type ArbitrumChainParams struct {
EnableArbOS bool
AllowDebugPrecompiles bool
Expand All @@ -60,6 +62,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 {
Expand Down Expand Up @@ -88,6 +91,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.
Expand Down
Loading