Skip to content

Commit

Permalink
replaced shanghai by galactica
Browse files Browse the repository at this point in the history
  • Loading branch information
freemanzMrojo committed Jan 13, 2025
1 parent 334f0d8 commit 5989787
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 51 deletions.
4 changes: 2 additions & 2 deletions genesis/customnet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func CustomNetWithParams(t *testing.T, executor genesis.Executor, baseGasPrice g
ETH_IST: math.MaxUint32,
VIP214: math.MaxUint32,
FINALITY: 0,
ETH_SH: 0,
GALACTICA: math.MaxUint32,
}

devAccounts := genesis.DevAccounts()
Expand Down Expand Up @@ -137,7 +137,7 @@ func TestNewCustomGenesisMarshalUnmarshal(t *testing.T) {
marshalVal, err := json.Marshal(customGenesis)
assert.NoError(t, err, "Marshaling should not produce an error")

expectedMarshal := `{"launchTime":1526400000,"gaslimit":0,"extraData":"","accounts":[{"address":"0x0000000000000000000000000000000000000000","balance":"0x0","energy":"0x0","code":"0x608060405234801561001057600080fd5b50606460008190555061017f806100286000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632f5f3b3c14610046578063a32a3ee414610064578063acfee28314610082575b600080fd5b61004e61009e565b60405161005b91906100d0565b60405180910390f35b61006c6100a4565b60405161007991906100d0565b60405180910390f35b61009c6004803603810190610097919061011c565b6100ad565b005b60005481565b60008054905090565b8060008190555050565b6000819050919050565b6100ca816100b7565b82525050565b60006020820190506100e560008301846100c1565b92915050565b600080fd5b6100f9816100b7565b811461010457600080fd5b50565b600081359050610116816100f0565b92915050565b600060208284031215610132576101316100eb565b5b600061014084828501610107565b9150509291505056fea2646970667358221220a1012465f7be855f040e95566de3bbd50542ba31a7730d7fea2ef9de563a9ac164736f6c63430008110033","storage":{"0x0000000000000000000000000000000000000000000000000000000000000001":"0x0000000000000000000000000000000000000000000000000000000000000002"}},{"address":"0x0000000000000000000000000000000000000000","balance":null,"energy":null,"code":"","storage":null}],"authority":[{"masterAddress":"0xf077b491b355e64048ce21e3a6fc4751eeea77fa","endorsorAddress":"0xf077b491b355e64048ce21e3a6fc4751eeea77fa","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x435933c8064b4ae76be665428e0307ef2ccfbd68","endorsorAddress":"0x435933c8064b4ae76be665428e0307ef2ccfbd68","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x0f872421dc479f3c11edd89512731814d0598db5","endorsorAddress":"0x0f872421dc479f3c11edd89512731814d0598db5","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0xf370940abdbd2583bc80bfc19d19bc216c88ccf0","endorsorAddress":"0xf370940abdbd2583bc80bfc19d19bc216c88ccf0","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x99602e4bbc0503b8ff4432bb1857f916c3653b85","endorsorAddress":"0x99602e4bbc0503b8ff4432bb1857f916c3653b85","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x61e7d0c2b25706be3485980f39a3a994a8207acf","endorsorAddress":"0x61e7d0c2b25706be3485980f39a3a994a8207acf","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x361277d1b27504f36a3b33d3a52d1f8270331b8c","endorsorAddress":"0x361277d1b27504f36a3b33d3a52d1f8270331b8c","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0xd7f75a0a1287ab2916848909c8531a0ea9412800","endorsorAddress":"0xd7f75a0a1287ab2916848909c8531a0ea9412800","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0xabef6032b9176c186f6bf984f548bda53349f70a","endorsorAddress":"0xabef6032b9176c186f6bf984f548bda53349f70a","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x865306084235bf804c8bba8a8d56890940ca8f0b","endorsorAddress":"0x865306084235bf804c8bba8a8d56890940ca8f0b","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"}],"params":{"rewardRatio":"-0x64","baseGasPrice":"0x0","proposerEndorsement":"0x0","executorAddress":null,"maxBlockProposers":10000},"executor":{"approvers":null},"forkConfig":{"VIP191":4294967295,"ETH_CONST":4294967295,"BLOCKLIST":4294967295,"ETH_IST":4294967295,"VIP214":4294967295,"FINALITY":0,"ETH_SH":0}}`
expectedMarshal := `{"launchTime":1526400000,"gaslimit":0,"extraData":"","accounts":[{"address":"0x0000000000000000000000000000000000000000","balance":"0x0","energy":"0x0","code":"0x608060405234801561001057600080fd5b50606460008190555061017f806100286000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632f5f3b3c14610046578063a32a3ee414610064578063acfee28314610082575b600080fd5b61004e61009e565b60405161005b91906100d0565b60405180910390f35b61006c6100a4565b60405161007991906100d0565b60405180910390f35b61009c6004803603810190610097919061011c565b6100ad565b005b60005481565b60008054905090565b8060008190555050565b6000819050919050565b6100ca816100b7565b82525050565b60006020820190506100e560008301846100c1565b92915050565b600080fd5b6100f9816100b7565b811461010457600080fd5b50565b600081359050610116816100f0565b92915050565b600060208284031215610132576101316100eb565b5b600061014084828501610107565b9150509291505056fea2646970667358221220a1012465f7be855f040e95566de3bbd50542ba31a7730d7fea2ef9de563a9ac164736f6c63430008110033","storage":{"0x0000000000000000000000000000000000000000000000000000000000000001":"0x0000000000000000000000000000000000000000000000000000000000000002"}},{"address":"0x0000000000000000000000000000000000000000","balance":null,"energy":null,"code":"","storage":null}],"authority":[{"masterAddress":"0xf077b491b355e64048ce21e3a6fc4751eeea77fa","endorsorAddress":"0xf077b491b355e64048ce21e3a6fc4751eeea77fa","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x435933c8064b4ae76be665428e0307ef2ccfbd68","endorsorAddress":"0x435933c8064b4ae76be665428e0307ef2ccfbd68","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x0f872421dc479f3c11edd89512731814d0598db5","endorsorAddress":"0x0f872421dc479f3c11edd89512731814d0598db5","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0xf370940abdbd2583bc80bfc19d19bc216c88ccf0","endorsorAddress":"0xf370940abdbd2583bc80bfc19d19bc216c88ccf0","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x99602e4bbc0503b8ff4432bb1857f916c3653b85","endorsorAddress":"0x99602e4bbc0503b8ff4432bb1857f916c3653b85","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x61e7d0c2b25706be3485980f39a3a994a8207acf","endorsorAddress":"0x61e7d0c2b25706be3485980f39a3a994a8207acf","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x361277d1b27504f36a3b33d3a52d1f8270331b8c","endorsorAddress":"0x361277d1b27504f36a3b33d3a52d1f8270331b8c","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0xd7f75a0a1287ab2916848909c8531a0ea9412800","endorsorAddress":"0xd7f75a0a1287ab2916848909c8531a0ea9412800","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0xabef6032b9176c186f6bf984f548bda53349f70a","endorsorAddress":"0xabef6032b9176c186f6bf984f548bda53349f70a","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"},{"masterAddress":"0x865306084235bf804c8bba8a8d56890940ca8f0b","endorsorAddress":"0x865306084235bf804c8bba8a8d56890940ca8f0b","identity":"0x00000000000000000000000000000000000000000000000000006d6173746572"}],"params":{"rewardRatio":"-0x64","baseGasPrice":"0x0","proposerEndorsement":"0x0","executorAddress":null,"maxBlockProposers":10000},"executor":{"approvers":null},"forkConfig":{"VIP191":4294967295,"ETH_CONST":4294967295,"BLOCKLIST":4294967295,"ETH_IST":4294967295,"VIP214":4294967295,"FINALITY":0,"GALACTICA":4294967295}}`
assert.Equal(t, expectedMarshal, string(marshalVal))
}

Expand Down
10 changes: 5 additions & 5 deletions runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ var baseChainConfig = vm.ChainConfig{
Ethash: nil,
Clique: nil,
},
IstanbulBlock: nil,
ShanghaiBlock: nil,
IstanbulBlock: nil,
GalacticaBlock: nil,
}

// Output output of clause execution.
Expand Down Expand Up @@ -99,15 +99,15 @@ func New(
currentChainConfig := baseChainConfig
currentChainConfig.ConstantinopleBlock = big.NewInt(int64(forkConfig.ETH_CONST))
currentChainConfig.IstanbulBlock = big.NewInt(int64(forkConfig.ETH_IST))
currentChainConfig.ShanghaiBlock = big.NewInt(int64(forkConfig.ETH_SH))
currentChainConfig.GalacticaBlock = big.NewInt(int64(forkConfig.GALACTICA))
if chain != nil {
// use genesis id as chain id
currentChainConfig.ChainID = new(big.Int).SetBytes(chain.GenesisID().Bytes())
}

// alloc precompiled contracts
if forkConfig.ETH_SH == ctx.Number {
for addr := range vm.PrecompiledContractsShanghai {
if forkConfig.GALACTICA == ctx.Number {
for addr := range vm.PrecompiledContractsGalactica {
if err := state.SetCode(thor.Address(addr), EmptyRuntimeBytecode); err != nil {
panic(err)
}
Expand Down
24 changes: 12 additions & 12 deletions runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,9 +236,9 @@ func TestEVMFunction(t *testing.T) {
},
}

shanghaiTests := []testcase{
galacticaTests := []testcase{
{
name: "pre ETH_SH deploy 0xEF started contract code",
name: "pre GALACTICA deploy 0xEF started contract code",
code: "",
abi: "",
methodName: "",
Expand All @@ -254,7 +254,7 @@ func TestEVMFunction(t *testing.T) {
},
},
{
name: "ETH_SH deploy 0xEF started contract code",
name: "GALACTICA deploy 0xEF started contract code",
code: "",
abi: "",
methodName: "",
Expand All @@ -274,7 +274,7 @@ func TestEVMFunction(t *testing.T) {
},
},
{
name: "ETH_SH deploy None 0xEF started contract code",
name: "GALACTICA deploy None 0xEF started contract code",
code: "",
abi: "",
methodName: "",
Expand All @@ -290,7 +290,7 @@ func TestEVMFunction(t *testing.T) {
},
},
{
name: "ETH_SH PUSH0 gas cost",
name: "GALACTICA PUSH0 gas cost",
code: "",
abi: "",
methodName: "",
Expand All @@ -307,7 +307,7 @@ func TestEVMFunction(t *testing.T) {
},
},
{
name: "ETH_SH BASEFEE output gas cost",
name: "GALACTICA BASEFEE output gas cost",
code: hex.EncodeToString([]byte{byte(vm.BASEFEE)}),
abi: "",
methodName: "",
Expand All @@ -323,7 +323,7 @@ func TestEVMFunction(t *testing.T) {
},
},
{
name: "ETH_SH BASEFEE",
name: "GALACTICA BASEFEE",
code: hex.EncodeToString([]byte{byte(vm.BASEFEE), byte(vm.PUSH1), 0x80, byte(vm.MSTORE), byte(vm.PUSH1), 0x20, byte(vm.PUSH1), 0x80, byte(vm.RETURN)}),
abi: "",
methodName: "",
Expand Down Expand Up @@ -370,7 +370,7 @@ func TestEVMFunction(t *testing.T) {

gasBefore := math.MaxUint64 - out.LeftOverGas

forkConfig.ETH_SH = 0
forkConfig.GALACTICA = 0
exec, _ = runtime.New(ctx.chain, ctx.state, &xenv.BlockContext{}, forkConfig).
PrepareClause(tx.NewClause(&target).WithData(methodData), 0, math.MaxUint64, &xenv.TransactionContext{})
out, _, err = exec()
Expand Down Expand Up @@ -415,7 +415,7 @@ func TestEVMFunction(t *testing.T) {

gasBefore := math.MaxUint64 - out.LeftOverGas

forkConfig.ETH_SH = 0
forkConfig.GALACTICA = 0
exec, _ = runtime.New(ctx.chain, ctx.state, &xenv.BlockContext{}, forkConfig).
PrepareClause(tx.NewClause(&target).WithData(methodData), 0, math.MaxUint64, &xenv.TransactionContext{})
out, _, err = exec()
Expand Down Expand Up @@ -460,7 +460,7 @@ func TestEVMFunction(t *testing.T) {

gasBefore := math.MaxUint64 - out.LeftOverGas

forkConfig.ETH_SH = 0
forkConfig.GALACTICA = 0
exec, _ = runtime.New(ctx.chain, ctx.state, &xenv.BlockContext{}, forkConfig).
PrepareClause(tx.NewClause(&target).WithData(methodData), 0, math.MaxUint64, &xenv.TransactionContext{})
out, _, err = exec()
Expand Down Expand Up @@ -506,7 +506,7 @@ func TestEVMFunction(t *testing.T) {

gasBefore := math.MaxUint64 - out.LeftOverGas

forkConfig.ETH_SH = 0
forkConfig.GALACTICA = 0
exec, _ = runtime.New(ctx.chain, ctx.state, &xenv.BlockContext{}, forkConfig).
PrepareClause(tx.NewClause(&target).WithData(methodData), 0, math.MaxUint64, &xenv.TransactionContext{})
out, _, err = exec()
Expand All @@ -524,7 +524,7 @@ func TestEVMFunction(t *testing.T) {
var tests = []testcase{}

tests = append(tests, baseTests...)
tests = append(tests, shanghaiTests...)
tests = append(tests, galacticaTests...)

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
Expand Down
10 changes: 5 additions & 5 deletions thor/fork_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type ForkConfig struct {
ETH_IST uint32
VIP214 uint32
FINALITY uint32
ETH_SH uint32
GALACTICA uint32
}

func (fc ForkConfig) String() string {
Expand All @@ -37,7 +37,7 @@ func (fc ForkConfig) String() string {
push("ETH_IST", fc.ETH_IST)
push("VIP214", fc.VIP214)
push("FINALITY", fc.FINALITY)
push("ETH_SH", fc.ETH_SH)
push("GALACTICA", fc.GALACTICA)

return strings.Join(strs, ", ")
}
Expand All @@ -50,7 +50,7 @@ var NoFork = ForkConfig{
ETH_IST: math.MaxUint32,
VIP214: math.MaxUint32,
FINALITY: math.MaxUint32,
ETH_SH: math.MaxUint32,
GALACTICA: math.MaxUint32,
}

// for well-known networks
Expand All @@ -63,7 +63,7 @@ var forkConfigs = map[Bytes32]ForkConfig{
ETH_IST: 9254300,
VIP214: 10653500,
FINALITY: 13815000, // ~ Thu, 17 Nov 2022 08:09:50 GMT
ETH_SH: math.MaxUint32,
GALACTICA: math.MaxUint32,
},
// testnet
MustParseBytes32("0x000000000b2bce3c70bc649a02749e8687721b09ed2e15997f466536b20bb127"): {
Expand All @@ -73,7 +73,7 @@ var forkConfigs = map[Bytes32]ForkConfig{
ETH_IST: 9146700,
VIP214: 10606800,
FINALITY: 13086360, // ~ Fri, 19 Aug 2022 08:00:00 GMT
ETH_SH: math.MaxUint32,
GALACTICA: math.MaxUint32,
},
}

Expand Down
2 changes: 1 addition & 1 deletion thor/fork_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestForkConfigString(t *testing.T) {
ETH_IST: math.MaxUint32,
VIP214: math.MaxUint32,
FINALITY: math.MaxUint32,
ETH_SH: math.MaxUint32,
GALACTICA: math.MaxUint32,
}

expectedStr := "VIP191: #1, BLOCKLIST: #2"
Expand Down
14 changes: 7 additions & 7 deletions vm/chain_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ func isForked(s, head *big.Int) bool {
// ChainConfig extends eth ChainConfig.
type ChainConfig struct {
params.ChainConfig
IstanbulBlock *big.Int // Istanbul switch block (nil = no fork, 0 = already on istanbul)
ShanghaiBlock *big.Int // Shanghai switch block (nil = no fork, 0 = already on shanghai)
IstanbulBlock *big.Int // Istanbul switch block (nil = no fork, 0 = already on istanbul)
GalacticaBlock *big.Int // Galactica switch block (nil = no fork, 0 = already on galactica)
}

// IsIstanbul returns whether num is either equal to the Istanbul fork block or greater.
func (c *ChainConfig) IsIstanbul(num *big.Int) bool {
return isForked(c.IstanbulBlock, num)
}

// IsShanghai returns whether num is either equal to the Shanghai fork block or greater.
func (c *ChainConfig) IsShanghai(num *big.Int) bool {
return isForked(c.ShanghaiBlock, num)
// IsGalactica returns whether num is either equal to the Galactica fork block or greater.
func (c *ChainConfig) IsGalactica(num *big.Int) bool {
return isForked(c.GalacticaBlock, num)
}

// Rules wraps ChainConfig and is merely syntatic sugar or can be used for functions
Expand All @@ -46,7 +46,7 @@ type Rules struct {
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
IsByzantium bool
IsIstanbul bool
IsShanghai bool
IsGalactica bool
}

// Rules ensures c's ChainID is not nil.
Expand All @@ -63,6 +63,6 @@ func (c *ChainConfig) Rules(num *big.Int) Rules {
IsEIP158: c.IsEIP158(num),
IsByzantium: c.IsByzantium(num),
IsIstanbul: c.IsIstanbul((num)),
IsShanghai: c.IsShanghai((num)),
IsGalactica: c.IsGalactica((num)),
}
}
18 changes: 9 additions & 9 deletions vm/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ var PrecompiledContractsIstanbul = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{9}): &blake2F{},
}

// PrecompiledContractsShanghai contains the default set of pre-compiled Ethereum
// PrecompiledContractsGalactica contains the default set of pre-compiled Ethereum
// contracts used in the Shanghai release.
// NOTE: Shanghai release does not introduce any changes in precompiled contracts.
// We are catching up from Istanbul, so Shanghai in thor includes eip1108 and eip2565.
var PrecompiledContractsShanghai = map[common.Address]PrecompiledContract{
// NOTE: Galactica release does not introduce any changes in precompiled contracts.
// We are catching up from Istanbul, so Galactica in thor includes eip1108 and eip2565.
var PrecompiledContractsGalactica = map[common.Address]PrecompiledContract{
common.BytesToAddress([]byte{1}): &safeEcrecover{},
common.BytesToAddress([]byte{2}): &sha256hash{},
common.BytesToAddress([]byte{3}): &ripemd160hash{},
Expand All @@ -94,7 +94,7 @@ var PrecompiledContractsShanghai = map[common.Address]PrecompiledContract{
}

var (
PrecompiledAddressesShanghai []common.Address
PrecompiledAddressesGalactica []common.Address
PrecompiledAddressesIstanbul []common.Address
PrecompiledAddressesByzantium []common.Address
PrecompiledAddressesHomestead []common.Address
Expand All @@ -110,16 +110,16 @@ func init() {
for k := range PrecompiledContractsIstanbul {
PrecompiledAddressesIstanbul = append(PrecompiledAddressesIstanbul, k)
}
for k := range PrecompiledContractsShanghai {
PrecompiledAddressesShanghai = append(PrecompiledAddressesShanghai, k)
for k := range PrecompiledContractsGalactica {
PrecompiledAddressesGalactica = append(PrecompiledAddressesGalactica, k)
}
}

// ActivePrecompiles returns the precompiles enabled with the current configuration.
func ActivePrecompiles(rules Rules) []common.Address {
switch {
case rules.IsShanghai:
return PrecompiledAddressesShanghai
case rules.IsGalactica:
return PrecompiledAddressesGalactica
case rules.IsIstanbul:
return PrecompiledAddressesIstanbul
default:
Expand Down
6 changes: 3 additions & 3 deletions vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type (
func (evm *EVM) precompile(addr common.Address) (PrecompiledContract, bool) {
var precompiles map[common.Address]PrecompiledContract
switch {
case evm.chainRules.IsShanghai:
precompiles = PrecompiledContractsShanghai
case evm.chainRules.IsGalactica:
precompiles = PrecompiledContractsGalactica
case evm.chainRules.IsIstanbul:
precompiles = PrecompiledContractsIstanbul
case evm.chainRules.IsByzantium:
Expand Down Expand Up @@ -492,7 +492,7 @@ func (evm *EVM) create(caller ContractRef, code []byte, gas uint64, value *big.I
}

// Reject code starting with 0xEF if EIP-3541 is enabled.
if err == nil && len(ret) >= 1 && ret[0] == 0xEF && evm.chainRules.IsShanghai {
if err == nil && len(ret) >= 1 && ret[0] == 0xEF && evm.chainRules.IsGalactica {
err = ErrInvalidCode
}

Expand Down
4 changes: 2 additions & 2 deletions vm/interpreter.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ func NewInterpreter(evm *EVM, cfg Config) *Interpreter {
// we'll set the default jump table.
if cfg.JumpTable == nil {
switch {
case evm.ChainConfig().IsShanghai(evm.BlockNumber):
cfg.JumpTable = shanghaiInstructionSet
case evm.ChainConfig().IsGalactica(evm.BlockNumber):
cfg.JumpTable = galacticaInstructionSet
case evm.ChainConfig().IsIstanbul(evm.BlockNumber):
cfg.JumpTable = istanbulInstructionSet
case evm.ChainConfig().IsConstantinople(evm.BlockNumber):
Expand Down
9 changes: 5 additions & 4 deletions vm/jump_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,15 @@ var (
byzantiumInstructionSet = NewByzantiumInstructionSet()
constantinopleInstructionSet = NewConstantinopleInstructionSet()
istanbulInstructionSet = NewIstanbulInstructionSet()
shanghaiInstructionSet = NewShanghaiInstructionSet()
galacticaInstructionSet = NewGalacticaInstructionSet()
)

type JumpTable [256]*operation

// NewShanghaiInstructionSet returns the frontier, homestead
// byzantium, constantinople , istanbul and shanghai instructions.
func NewShanghaiInstructionSet() *JumpTable {
// NewGalacticaInstructionSet returns the frontier, homestead
// byzantium, constantinople , istanbul and shanghai (included in galactica)
// instructions.
func NewGalacticaInstructionSet() *JumpTable {
instructionSet := NewIstanbulInstructionSet()
instructionSet[BASEFEE] = &operation{
execute: opBaseFee,
Expand Down
2 changes: 1 addition & 1 deletion vm/jump_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func TestPush0OpCode(t *testing.T) {
// Arrange
mockStack := newstack()
jt := NewShanghaiInstructionSet()
jt := NewGalacticaInstructionSet()
push0 := jt[PUSH0]

// Check the stack is empty before executing PUSH0
Expand Down

0 comments on commit 5989787

Please sign in to comment.