From acbb531492aec81d0ef2daf636aecd740f856add Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Tue, 6 Aug 2019 14:14:13 +0200 Subject: [PATCH] core/vm: 1884-changes to extcodehash, move selfbalance opcode --- core/vm/eips.go | 6 +++--- core/vm/opcodes.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/vm/eips.go b/core/vm/eips.go index f1f73a1313..0e1cff0c49 100644 --- a/core/vm/eips.go +++ b/core/vm/eips.go @@ -18,8 +18,6 @@ package vm import "fmt" - - // EnableEIP enables the given EIP on the config. // This operation write in-place, and callers need to ensure that the globally // defined jumptables are not polluted @@ -35,11 +33,13 @@ func EnableEIP(eipNum int, jt *JumpTable) error { // Enable1884 applies EIP-1884 to the given jumptable // - Increase cost of BALANCE to 700 +// - Increase cost of EXTCODEHASH to 700 // - Increase cost of SLOAD to 800 -// - Define SELFBALANCE, with cost GasFastStep +// - Define SELFBALANCE, with cost GasFastStep (5) func enable1884(jt *JumpTable) { // Gas cost changes jt[BALANCE].constantGas = 700 + jt[EXTCODEHASH].constantGas = 700 jt[SLOAD].constantGas = 800 // New opcode jt[SELFBALANCE] = operation{ diff --git a/core/vm/opcodes.go b/core/vm/opcodes.go index 681440bc9f..b385fd14ad 100644 --- a/core/vm/opcodes.go +++ b/core/vm/opcodes.go @@ -101,7 +101,7 @@ const ( NUMBER DIFFICULTY GASLIMIT - SELFBALANCE + SELFBALANCE = 0x47 ) // 0x50 range - 'storage' and execution.