@ -84,16 +84,16 @@ var (
//
// This configuration is intentionally not using keyed fields to force anyone
// adding flags to the config to also have to set these fields.
AllEthashProtocolChanges = & ChainConfig { big . NewInt ( 1337 ) , big . NewInt ( 0 ) , nil , false , big . NewInt ( 0 ) , common . Hash { } , big . NewInt ( 0 ) , big . NewInt ( 0 ) , big . NewInt ( 0 ) , nil , new ( EthashConfig ) , nil }
AllEthashProtocolChanges = & ChainConfig { big . NewInt ( 1337 ) , big . NewInt ( 0 ) , nil , false , big . NewInt ( 0 ) , common . Hash { } , big . NewInt ( 0 ) , big . NewInt ( 0 ) , big . NewInt ( 0 ) , nil , nil , new ( EthashConfig ) , nil }
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers into the Clique consensus.
//
// This configuration is intentionally not using keyed fields to force anyone
// adding flags to the config to also have to set these fields.
AllCliqueProtocolChanges = & ChainConfig { big . NewInt ( 1337 ) , big . NewInt ( 0 ) , nil , false , big . NewInt ( 0 ) , common . Hash { } , big . NewInt ( 0 ) , big . NewInt ( 0 ) , big . NewInt ( 0 ) , nil , nil , & CliqueConfig { Period : 0 , Epoch : 30000 } }
AllCliqueProtocolChanges = & ChainConfig { big . NewInt ( 1337 ) , big . NewInt ( 0 ) , nil , false , big . NewInt ( 0 ) , common . Hash { } , big . NewInt ( 0 ) , big . NewInt ( 0 ) , big . NewInt ( 0 ) , nil , nil , nil , & CliqueConfig { Period : 0 , Epoch : 30000 } }
TestChainConfig = & ChainConfig { big . NewInt ( 1 ) , big . NewInt ( 0 ) , nil , false , big . NewInt ( 0 ) , common . Hash { } , big . NewInt ( 0 ) , big . NewInt ( 0 ) , big . NewInt ( 0 ) , nil , new ( EthashConfig ) , nil }
TestChainConfig = & ChainConfig { big . NewInt ( 1 ) , big . NewInt ( 0 ) , nil , false , big . NewInt ( 0 ) , common . Hash { } , big . NewInt ( 0 ) , big . NewInt ( 0 ) , big . NewInt ( 0 ) , nil , nil , new ( EthashConfig ) , nil }
TestRules = TestChainConfig . Rules ( new ( big . Int ) )
)
@ -119,6 +119,7 @@ type ChainConfig struct {
ByzantiumBlock * big . Int ` json:"byzantiumBlock,omitempty" ` // Byzantium switch block (nil = no fork, 0 = already on byzantium)
ConstantinopleBlock * big . Int ` json:"constantinopleBlock,omitempty" ` // Constantinople switch block (nil = no fork, 0 = already activated)
EWASMBlock * big . Int ` json:"ewasmBlock,omitempty" ` // EWASM switch block (nil = no fork, 0 = already activated)
// Various consensus engines
Ethash * EthashConfig ` json:"ethash,omitempty" `
@ -204,6 +205,11 @@ func (c *ChainConfig) IsConstantinople(num *big.Int) bool {
return isForked ( c . ConstantinopleBlock , num )
}
// IsEWASM returns whether num represents a block number after the EWASM fork
func ( c * ChainConfig ) IsEWASM ( num * big . Int ) bool {
return isForked ( c . EWASMBlock , num )
}
// GasTable returns the gas table corresponding to the current phase (homestead or homestead reprice).
//
// The returned GasTable's fields shouldn't, under any circumstances, be changed.
@ -269,6 +275,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
if isForkIncompatible ( c . ConstantinopleBlock , newcfg . ConstantinopleBlock , head ) {
return newCompatError ( "Constantinople fork block" , c . ConstantinopleBlock , newcfg . ConstantinopleBlock )
}
if isForkIncompatible ( c . EWASMBlock , newcfg . EWASMBlock , head ) {
return newCompatError ( "ewasm fork block" , c . EWASMBlock , newcfg . EWASMBlock )
}
return nil
}