cmd,core,eth,params,tests: define yolov3 + enable EIP-2565 (#22213)

Removes the yolov2 definition, adds yolov3, including EIP-2565. This PR also disables some of the erroneously generated blockchain and statetests, and adds the new genesis hash + alloc for yolov3. 
This PR disables the CLI switches for yolo, since it's not complete until we merge support for 2930.
This commit is contained in:
Sina Mahmoodi
2021-01-28 21:19:07 +01:00
committed by GitHub
parent 2e5d141708
commit eb21c652c0
23 changed files with 112 additions and 88 deletions

View File

@ -46,8 +46,8 @@ type (
// configuration
func (evm *EVM) ActivePrecompiles() []common.Address {
switch {
case evm.chainRules.IsYoloV2:
return PrecompiledAddressesYoloV2
case evm.chainRules.IsYoloV3:
return PrecompiledAddressesYoloV3
case evm.chainRules.IsIstanbul:
return PrecompiledAddressesIstanbul
case evm.chainRules.IsByzantium:
@ -60,8 +60,8 @@ func (evm *EVM) ActivePrecompiles() []common.Address {
func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
var precompiles map[common.Address]PrecompiledContract
switch {
case evm.chainRules.IsYoloV2:
precompiles = PrecompiledContractsYoloV2
case evm.chainRules.IsYoloV3:
precompiles = PrecompiledContractsYoloV3
case evm.chainRules.IsIstanbul:
precompiles = PrecompiledContractsIstanbul
case evm.chainRules.IsByzantium:
@ -446,7 +446,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64,
evm.StateDB.SetNonce(caller.Address(), nonce+1)
// We add this to the access list _before_ taking a snapshot. Even if the creation fails,
// the access-list change should not be rolled back
if evm.chainRules.IsYoloV2 {
if evm.chainRules.IsYoloV3 {
evm.StateDB.AddAddressToAccessList(address)
}
// Ensure there's no existing contract already at the designated address