Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions params/config_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,18 @@ 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
DataAvailabilityCommittee bool
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 {
Expand Down Expand Up @@ -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.
Expand Down
Loading