Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core/vm: define cancun + enable 1153 (tstore/tload) in cancun #27663

Merged
merged 1 commit into from Jul 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions core/vm/jump_table.go
Expand Up @@ -83,6 +83,7 @@ func validate(jt JumpTable) JumpTable {
func newCancunInstructionSet() JumpTable {
instructionSet := newShanghaiInstructionSet()
enable4844(&instructionSet) // BLOBHASH opcode
enable1153(&instructionSet) // EIP-1153 "Transient Storage"
return validate(instructionSet)
}

Expand Down
6 changes: 3 additions & 3 deletions core/vm/jump_table_export.go
Expand Up @@ -27,11 +27,11 @@ import (
func LookupInstructionSet(rules params.Rules) (JumpTable, error) {
switch {
case rules.IsVerkle:
return newShanghaiInstructionSet(), errors.New("verkle-fork not defined yet")
return newCancunInstructionSet(), errors.New("verkle-fork not defined yet")
case rules.IsPrague:
return newShanghaiInstructionSet(), errors.New("prague-fork not defined yet")
return newCancunInstructionSet(), errors.New("prague-fork not defined yet")
case rules.IsCancun:
return newShanghaiInstructionSet(), errors.New("cancun-fork not defined yet")
return newCancunInstructionSet(), nil
case rules.IsShanghai:
return newShanghaiInstructionSet(), nil
case rules.IsMerge:
Expand Down
19 changes: 19 additions & 0 deletions tests/init.go
Expand Up @@ -299,6 +299,25 @@ var Forks = map[string]*params.ChainConfig{
TerminalTotalDifficulty: big.NewInt(0),
ShanghaiTime: u64(15_000),
},
"Cancun": {
ChainID: big.NewInt(1),
HomesteadBlock: big.NewInt(0),
EIP150Block: big.NewInt(0),
EIP155Block: big.NewInt(0),
EIP158Block: big.NewInt(0),
ByzantiumBlock: big.NewInt(0),
ConstantinopleBlock: big.NewInt(0),
PetersburgBlock: big.NewInt(0),
IstanbulBlock: big.NewInt(0),
MuirGlacierBlock: big.NewInt(0),
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
ArrowGlacierBlock: big.NewInt(0),
MergeNetsplitBlock: big.NewInt(0),
TerminalTotalDifficulty: big.NewInt(0),
ShanghaiTime: u64(0),
CancunTime: u64(0),
},
}

// AvailableForks returns the set of defined fork names
Expand Down