all: implement EIP-2929 (gas cost increases for state access opcodes) + yolo-v2 (#21509)
* core/vm, core/state: implement EIP-2929 + YOLOv2 * core/state, core/vm: fix some review concerns * core/state, core/vm: address review concerns * core/vm: address review concerns * core/vm: better documentation * core/vm: unify sload cost as fully dynamic * core/vm: fix typo * core/vm/runtime: fix compilation flaw * core/vm/runtime: fix renaming-err leftovers * core/vm: renaming * params/config: use correct yolov2 chainid for config * core, params: use a proper new genesis for yolov2 * core/state/tests: golinter nitpicks
This commit is contained in:
committed by
GitHub
parent
fb2c79df19
commit
6487c002f6
@ -141,7 +141,7 @@ var Forks = map[string]*params.ChainConfig{
|
||||
PetersburgBlock: big.NewInt(0),
|
||||
IstanbulBlock: big.NewInt(5),
|
||||
},
|
||||
"YOLOv1": {
|
||||
"YOLOv2": {
|
||||
ChainID: big.NewInt(1),
|
||||
HomesteadBlock: big.NewInt(0),
|
||||
EIP150Block: big.NewInt(0),
|
||||
@ -151,9 +151,9 @@ var Forks = map[string]*params.ChainConfig{
|
||||
ConstantinopleBlock: big.NewInt(0),
|
||||
PetersburgBlock: big.NewInt(0),
|
||||
IstanbulBlock: big.NewInt(0),
|
||||
YoloV1Block: big.NewInt(0),
|
||||
YoloV2Block: big.NewInt(0),
|
||||
},
|
||||
// This specification is subject to change, but is for now identical to YOLOv1
|
||||
// This specification is subject to change, but is for now identical to YOLOv2
|
||||
// for cross-client testing purposes
|
||||
"Berlin": {
|
||||
ChainID: big.NewInt(1),
|
||||
@ -165,7 +165,7 @@ var Forks = map[string]*params.ChainConfig{
|
||||
ConstantinopleBlock: big.NewInt(0),
|
||||
PetersburgBlock: big.NewInt(0),
|
||||
IstanbulBlock: big.NewInt(0),
|
||||
YoloV1Block: big.NewInt(0),
|
||||
YoloV2Block: big.NewInt(0),
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -186,6 +186,16 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
|
||||
context.GetHash = vmTestBlockHash
|
||||
evm := vm.NewEVM(context, statedb, config, vmconfig)
|
||||
|
||||
if config.IsYoloV2(context.BlockNumber) {
|
||||
statedb.AddAddressToAccessList(msg.From())
|
||||
if dst := msg.To(); dst != nil {
|
||||
statedb.AddAddressToAccessList(*dst)
|
||||
// If it's a create-tx, the destination will be added inside evm.create
|
||||
}
|
||||
for _, addr := range evm.ActivePrecompiles() {
|
||||
statedb.AddAddressToAccessList(addr)
|
||||
}
|
||||
}
|
||||
gaspool := new(core.GasPool)
|
||||
gaspool.AddGas(block.GasLimit())
|
||||
snapshot := statedb.Snapshot()
|
||||
|
Reference in New Issue
Block a user