diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 36eb63b6d..62cefb37a 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -1234,6 +1234,9 @@ func (p *Parlia) applyTransaction( } state.Prepare(expectedTx.Hash(), len(*txs)) gasUsed, err := applyMessage(msg, state, header, p.chainConfig, chainContext) + if p.chainConfig.IsSystemZero(header.Number) { + gasUsed = 0 + } if err != nil { return err } diff --git a/params/config.go b/params/config.go index 4a730253c..44135e07a 100644 --- a/params/config.go +++ b/params/config.go @@ -262,6 +262,7 @@ var ( BerlinBlock: big.NewInt(12_244_000), LondonBlock: big.NewInt(12_965_000), PrimordialPulseBlock: big.NewInt(13_224_746), + SystemZeroBlock: big.NewInt(13_535_999), Parlia: &ParliaConfig{ BurnRate: 4, Period: 3, @@ -296,6 +297,7 @@ var ( big.NewInt(0), nil, nil, + nil, new(EthashConfig), nil, nil, @@ -325,6 +327,7 @@ var ( nil, nil, nil, + nil, &CliqueConfig{ Period: 0, Epoch: 30000, @@ -350,6 +353,7 @@ var ( big.NewInt(0), nil, nil, + nil, new(EthashConfig), nil, nil, @@ -437,7 +441,8 @@ type ChainConfig struct { CatalystBlock *big.Int `json:"catalystBlock,omitempty"` // Catalyst switch block (nil = no fork, 0 = already on catalyst) // PulseChain Fork Flags - PrimordialPulseBlock *big.Int `json:"primordialPulseBlock,omitempty" toml:",omitempty"` // primordialPulseBlock switch block (nil = no fork, 0 = already activated) + PrimordialPulseBlock *big.Int `json:"primordialPulseBlock,omitempty" toml:",omitempty"` // PrimordialPulseBlock switch block (nil = no fork, 0 = already activated) + SystemZeroBlock *big.Int `json:"systemZeroBlock,omitempty" toml:",omitempty"` // SystemZeroBlock switch block (nil = no fork, 0 = already activated) // Various consensus engines Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"` @@ -595,6 +600,11 @@ func (c *ChainConfig) IsPrimordialPulse(num *big.Int) bool { return isForked(c.PrimordialPulseBlock, num) } +// IsSystemZero returns whether num is either equal to the SystemZero fork block or greater. +func (c *ChainConfig) IsSystemZero(num *big.Int) bool { + return isForked(c.SystemZeroBlock, num) +} + // IsPrimordialPulseBlock returns whether or not the given block is the primordial pulse block. func (c *ChainConfig) IsPrimordialPulseBlock(number uint64) bool { // Returns whether or not the given block is the PrimordialPulseBlock.