From 59897878ac45d783c9c582a3b6787af36cf9eb6a Mon Sep 17 00:00:00 2001 From: Miguel Angel Rojo Fernandez Date: Mon, 13 Jan 2025 11:44:47 +0000 Subject: [PATCH] replaced shanghai by galactica --- genesis/customnet_test.go | 4 ++-- runtime/runtime.go | 10 +++++----- runtime/runtime_test.go | 24 ++++++++++++------------ thor/fork_config.go | 10 +++++----- thor/fork_config_test.go | 2 +- vm/chain_config.go | 14 +++++++------- vm/contracts.go | 18 +++++++++--------- vm/evm.go | 6 +++--- vm/interpreter.go | 4 ++-- vm/jump_table.go | 9 +++++---- vm/jump_table_test.go | 2 +- 11 files changed, 52 insertions(+), 51 deletions(-) diff --git a/genesis/customnet_test.go b/genesis/customnet_test.go index fa69ae989..625953a21 100644 --- a/genesis/customnet_test.go +++ b/genesis/customnet_test.go @@ -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() @@ -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)) } diff --git a/runtime/runtime.go b/runtime/runtime.go index 884fe6a83..43594b4c1 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -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. @@ -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) } diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index e05b258c8..c0bb140d3 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -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: "", @@ -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: "", @@ -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: "", @@ -290,7 +290,7 @@ func TestEVMFunction(t *testing.T) { }, }, { - name: "ETH_SH PUSH0 gas cost", + name: "GALACTICA PUSH0 gas cost", code: "", abi: "", methodName: "", @@ -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: "", @@ -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: "", @@ -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() @@ -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() @@ -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() @@ -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() @@ -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) { diff --git a/thor/fork_config.go b/thor/fork_config.go index 3e9fa377b..95ae288fe 100644 --- a/thor/fork_config.go +++ b/thor/fork_config.go @@ -20,7 +20,7 @@ type ForkConfig struct { ETH_IST uint32 VIP214 uint32 FINALITY uint32 - ETH_SH uint32 + GALACTICA uint32 } func (fc ForkConfig) String() string { @@ -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, ", ") } @@ -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 @@ -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"): { @@ -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, }, } diff --git a/thor/fork_config_test.go b/thor/fork_config_test.go index c05c959f5..847f0d1fc 100644 --- a/thor/fork_config_test.go +++ b/thor/fork_config_test.go @@ -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" diff --git a/vm/chain_config.go b/vm/chain_config.go index 62cd17837..391bdf83f 100644 --- a/vm/chain_config.go +++ b/vm/chain_config.go @@ -22,8 +22,8 @@ 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. @@ -31,9 +31,9 @@ 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 @@ -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. @@ -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)), } } diff --git a/vm/contracts.go b/vm/contracts.go index 8b1a98c73..323fc4e0b 100644 --- a/vm/contracts.go +++ b/vm/contracts.go @@ -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{}, @@ -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 @@ -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: diff --git a/vm/evm.go b/vm/evm.go index fcba8ed32..79fbebcdf 100644 --- a/vm/evm.go +++ b/vm/evm.go @@ -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: @@ -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 } diff --git a/vm/interpreter.go b/vm/interpreter.go index f4ff5cf7e..fcf02e622 100644 --- a/vm/interpreter.go +++ b/vm/interpreter.go @@ -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): diff --git a/vm/jump_table.go b/vm/jump_table.go index 886831fb9..8eaf09d65 100644 --- a/vm/jump_table.go +++ b/vm/jump_table.go @@ -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, diff --git a/vm/jump_table_test.go b/vm/jump_table_test.go index 5e1c64415..008c758d2 100644 --- a/vm/jump_table_test.go +++ b/vm/jump_table_test.go @@ -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