mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
core/vm: define cancun + enable 1153 (tstore/tload) in cancun (#27663)
This commit is contained in:
parent
07fd1c64cf
commit
240de84287
2 changed files with 7 additions and 3 deletions
|
|
@ -80,6 +80,12 @@ func validate(jt JumpTable) JumpTable {
|
||||||
return jt
|
return jt
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func newCancunInstructionSet() JumpTable {
|
||||||
|
instructionSet := newEip1559InstructionSet()
|
||||||
|
enable1153(&instructionSet) // EIP-1153 "Transient Storage"
|
||||||
|
return validate(instructionSet)
|
||||||
|
}
|
||||||
|
|
||||||
func newEip1559InstructionSet() JumpTable {
|
func newEip1559InstructionSet() JumpTable {
|
||||||
instructionSet := newShanghaiInstructionSet()
|
instructionSet := newShanghaiInstructionSet()
|
||||||
enable2929(&instructionSet) // Gas cost increases for state access opcodes https://eips.ethereum.org/EIPS/eip-2929
|
enable2929(&instructionSet) // Gas cost increases for state access opcodes https://eips.ethereum.org/EIPS/eip-2929
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@
|
||||||
package vm
|
package vm
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
|
|
||||||
"github.com/XinFinOrg/XDPoSChain/params"
|
"github.com/XinFinOrg/XDPoSChain/params"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -27,7 +25,7 @@ import (
|
||||||
func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
|
func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
|
||||||
switch {
|
switch {
|
||||||
case rules.IsCancun:
|
case rules.IsCancun:
|
||||||
return newEip1559InstructionSet(), errors.New("cancun-fork not defined yet")
|
return newCancunInstructionSet(), nil
|
||||||
case rules.IsEIP1559:
|
case rules.IsEIP1559:
|
||||||
return newEip1559InstructionSet(), nil
|
return newEip1559InstructionSet(), nil
|
||||||
case rules.IsShanghai:
|
case rules.IsShanghai:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue