From e15637ec8a4c42c27d0010632f25fb1ca802df57 Mon Sep 17 00:00:00 2001 From: meows Date: Mon, 3 Jan 2022 07:14:42 -0800 Subject: [PATCH 1/5] tests: StateTest generation config for ETC_Mystique Date: 2022-01-03 07:14:42-08:00 Signed-off-by: meows --- tests/init.go | 59 ++++++++++++++++++++++++++++++++++++++++ tests/state_mgen_test.go | 1 + 2 files changed, 60 insertions(+) diff --git a/tests/init.go b/tests/init.go index 437bbdc3505b..5bc0dfdfb9e9 100644 --- a/tests/init.go +++ b/tests/init.go @@ -364,6 +364,65 @@ var Forks = map[string]ctypes.ChainConfigurator{ EIP2718FBlock: big.NewInt(0), EIP2930FBlock: big.NewInt(0), + DisposalBlock: big.NewInt(0), + ECIP1017FBlock: big.NewInt(5000000), // FIXME(meows) maybe + ECIP1017EraRounds: big.NewInt(5000000), + ECIP1010PauseBlock: nil, + ECIP1010Length: nil, + }, + "ETC_Mystique": &coregeth.CoreGethChainConfig{ + NetworkID: 1, + Ethash: new(ctypes.EthashConfig), + ChainID: big.NewInt(61), + EIP2FBlock: big.NewInt(0), + EIP7FBlock: big.NewInt(0), + EIP150Block: big.NewInt(0), + EIP155Block: big.NewInt(0), + EIP160FBlock: big.NewInt(0), + EIP161FBlock: big.NewInt(0), + EIP170FBlock: big.NewInt(0), + EIP100FBlock: big.NewInt(0), + EIP140FBlock: big.NewInt(0), + EIP198FBlock: big.NewInt(0), + EIP211FBlock: big.NewInt(0), + EIP212FBlock: big.NewInt(0), + EIP213FBlock: big.NewInt(0), + EIP214FBlock: big.NewInt(0), + EIP658FBlock: big.NewInt(0), + EIP145FBlock: big.NewInt(0), + EIP1014FBlock: big.NewInt(0), + EIP1052FBlock: big.NewInt(0), + EIP1283FBlock: big.NewInt(0), + PetersburgBlock: big.NewInt(0), + // Istanbul eq, aka Phoenix + // ECIP-1088 + EIP152FBlock: big.NewInt(0), + EIP1108FBlock: big.NewInt(0), + EIP1344FBlock: big.NewInt(0), + EIP1884FBlock: big.NewInt(0), + EIP2028FBlock: big.NewInt(0), + EIP2200FBlock: big.NewInt(0), // RePetersburg (=~ re-1283) + + // Berlin + EIP2565FBlock: big.NewInt(0), + EIP2929FBlock: big.NewInt(0), + EIP2718FBlock: big.NewInt(0), + EIP2930FBlock: big.NewInt(0), + + // London + /* + 3529 (Alternative refund reduction) #22733 Include + 3541 (Reject new contracts starting with the 0xEF byte) #22809 Include + 1559 (Fee market change) #22837 #22896 Omit + 3198 (BASEFEE opcode) #22837 Omit + 3228 (bomb delay) #22840 and #22870 Omit + */ + EIP3529FBlock: big.NewInt(0), + EIP3541FBlock: big.NewInt(0), + EIP1559FBlock: nil, + EIP3198FBlock: nil, + EIP3554FBlock: nil, + DisposalBlock: big.NewInt(0), ECIP1017FBlock: big.NewInt(5000000), // FIXME(meows) maybe ECIP1017EraRounds: big.NewInt(5000000), diff --git a/tests/state_mgen_test.go b/tests/state_mgen_test.go index b17e79cf2b19..0f91e382ba52 100644 --- a/tests/state_mgen_test.go +++ b/tests/state_mgen_test.go @@ -104,6 +104,7 @@ func TestGenStateAll(t *testing.T) { tm.generateFromReference("ConstantinopleFix", "ETC_Agharta") tm.generateFromReference("Berlin", "ETC_Magneto") tm.generateFromReference("Istanbul", "ETC_Phoenix") + tm.generateFromReference("London", "ETC_Mystique") for _, dir := range []string{ stateTestDir, From 019b4d0b7d1de410c6049a85492f1bade0c93bbd Mon Sep 17 00:00:00 2001 From: meows Date: Mon, 3 Jan 2022 07:41:53 -0800 Subject: [PATCH 2/5] tests: generate state tests eth_london:etc_mystique Date: 2022-01-03 07:41:53-08:00 Signed-off-by: meows --- tests/testdata | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testdata b/tests/testdata index aad0e35d8918..2895f8a79af5 160000 --- a/tests/testdata +++ b/tests/testdata @@ -1 +1 @@ -Subproject commit aad0e35d8918a16ece01bba74817788d2960649b +Subproject commit 2895f8a79af520185e252ad0367a823e4efa8302 From 3d32809c287070726f78a0f7aa57bedccd132851 Mon Sep 17 00:00:00 2001 From: meows Date: Mon, 3 Jan 2022 13:32:29 -0800 Subject: [PATCH 3/5] params/types/multigeth,tests: two fixes for multigeth-config test fails on ETC_Mystique suite Date: 2022-01-03 13:32:29-08:00 Signed-off-by: meows --- .../multigethv0_chain_config_configurator.go | 28 +++++++++++++++++++ tests/state_test.go | 16 +++++++---- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/params/types/multigeth/multigethv0_chain_config_configurator.go b/params/types/multigeth/multigethv0_chain_config_configurator.go index d0ea3ef40905..1619e92f2596 100644 --- a/params/types/multigeth/multigethv0_chain_config_configurator.go +++ b/params/types/multigeth/multigethv0_chain_config_configurator.go @@ -494,6 +494,28 @@ func (c *ChainConfig) GetEIP1559Transition() *uint64 { } func (c *ChainConfig) SetEIP1559Transition(n *uint64) error { + if n == nil && c.LondonBlock != nil { + // Once set, the London feature batch cannot be unset. + // This is annoying, but necessary. + // The core-geth configuration interface pattern + // allows only SOME features from the London fork to be + // activated. + // In programmatically converting between the two + // interface types (core-geth vs. go-ethereum|multi-geth), + // configurations are unilaterally specific; + // all configurations available with the go-ethereum config + // can be represented in the core-geth config; + // BUT not all configurations possible with the core-geth + // config are possible with the go-ethereum config. + // + // So we hack it. + // We know the conventional use case for this problem; + // translating configuration types for tests, usually + // where the configs are defaults. + // We know that Ethereum Classic implements partial sets + // of fork-feature sets on Ethereum Foundation. + return ctypes.ErrUnsupportedConfigNoop + } c.LondonBlock = setBig(c.LondonBlock, n) return nil } @@ -503,6 +525,9 @@ func (c *ChainConfig) GetEIP3541Transition() *uint64 { } func (c *ChainConfig) SetEIP3541Transition(n *uint64) error { + if n == nil && c.LondonBlock != nil { + return ctypes.ErrUnsupportedConfigNoop + } c.LondonBlock = setBig(c.LondonBlock, n) return nil } @@ -512,6 +537,9 @@ func (c *ChainConfig) GetEIP3529Transition() *uint64 { } func (c *ChainConfig) SetEIP3529Transition(n *uint64) error { + if n == nil && c.LondonBlock != nil { + return ctypes.ErrUnsupportedConfigNoop + } c.LondonBlock = setBig(c.LondonBlock, n) return nil } diff --git a/tests/state_test.go b/tests/state_test.go index b37f05512377..349ca6b81031 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -20,6 +20,7 @@ import ( "bufio" "bytes" "fmt" + "os" "reflect" "strings" "testing" @@ -69,18 +70,21 @@ func TestState(t *testing.T) { st.skipFork("Magneto") st.skipFork("London") } + if os.Getenv(CG_CHAINCONFIG_FEATURE_EQ_MULTIGETHV0_KEY) != "" { + st.skipFork("ETC_Mystique") + } // Un-skip this when https://github.com/ethereum/tests/issues/908 is closed st.skipLoad(`^stQuadraticComplexityTest/QuadraticComplexitySolidity_CallDataCopy`) // Broken tests: // Expected failures: - //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/0`, "bug in test") - //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/3`, "bug in test") - //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/0`, "bug in test") - //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/3`, "bug in test") - //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/0`, "bug in test") - //st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/3`, "bug in test") + // st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/0`, "bug in test") + // st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Byzantium/3`, "bug in test") + // st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/0`, "bug in test") + // st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/Constantinople/3`, "bug in test") + // st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/0`, "bug in test") + // st.fails(`^stRevertTest/RevertPrecompiledTouch(_storage)?\.json/ConstantinopleFix/3`, "bug in test") // For Istanbul, older tests were moved into LegacyTests for _, dir := range []string{ From 730ff1d1655f26950c542b0d234113d3b9e6ef3a Mon Sep 17 00:00:00 2001 From: meows Date: Tue, 4 Jan 2022 05:06:54 -0800 Subject: [PATCH 4/5] params/types/multigeth,tests: only use state test skip for mystique/multi-geth config This configuration cannot be represented in the multi-geth/ethereum data type. The state tests are skipped when running the core-geth-ONLY tests that convert data types and rerun tests to ensure interoperability. Date: 2022-01-04 05:06:54-08:00 Signed-off-by: meows --- .../multigethv0_chain_config_configurator.go | 28 ------------------- tests/init.go | 2 ++ tests/state_test.go | 3 ++ 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/params/types/multigeth/multigethv0_chain_config_configurator.go b/params/types/multigeth/multigethv0_chain_config_configurator.go index 1619e92f2596..d0ea3ef40905 100644 --- a/params/types/multigeth/multigethv0_chain_config_configurator.go +++ b/params/types/multigeth/multigethv0_chain_config_configurator.go @@ -494,28 +494,6 @@ func (c *ChainConfig) GetEIP1559Transition() *uint64 { } func (c *ChainConfig) SetEIP1559Transition(n *uint64) error { - if n == nil && c.LondonBlock != nil { - // Once set, the London feature batch cannot be unset. - // This is annoying, but necessary. - // The core-geth configuration interface pattern - // allows only SOME features from the London fork to be - // activated. - // In programmatically converting between the two - // interface types (core-geth vs. go-ethereum|multi-geth), - // configurations are unilaterally specific; - // all configurations available with the go-ethereum config - // can be represented in the core-geth config; - // BUT not all configurations possible with the core-geth - // config are possible with the go-ethereum config. - // - // So we hack it. - // We know the conventional use case for this problem; - // translating configuration types for tests, usually - // where the configs are defaults. - // We know that Ethereum Classic implements partial sets - // of fork-feature sets on Ethereum Foundation. - return ctypes.ErrUnsupportedConfigNoop - } c.LondonBlock = setBig(c.LondonBlock, n) return nil } @@ -525,9 +503,6 @@ func (c *ChainConfig) GetEIP3541Transition() *uint64 { } func (c *ChainConfig) SetEIP3541Transition(n *uint64) error { - if n == nil && c.LondonBlock != nil { - return ctypes.ErrUnsupportedConfigNoop - } c.LondonBlock = setBig(c.LondonBlock, n) return nil } @@ -537,9 +512,6 @@ func (c *ChainConfig) GetEIP3529Transition() *uint64 { } func (c *ChainConfig) SetEIP3529Transition(n *uint64) error { - if n == nil && c.LondonBlock != nil { - return ctypes.ErrUnsupportedConfigNoop - } c.LondonBlock = setBig(c.LondonBlock, n) return nil } diff --git a/tests/init.go b/tests/init.go index 5bc0dfdfb9e9..466a8411de2a 100644 --- a/tests/init.go +++ b/tests/init.go @@ -411,6 +411,8 @@ var Forks = map[string]ctypes.ChainConfigurator{ // London /* + https://github.com/ethereumclassic/ECIPs/blob/master/_specs/ecip-1104.md + 3529 (Alternative refund reduction) #22733 Include 3541 (Reject new contracts starting with the 0xEF byte) #22809 Include 1559 (Fee market change) #22837 #22896 Omit diff --git a/tests/state_test.go b/tests/state_test.go index 349ca6b81031..071a2c4b726a 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -70,6 +70,9 @@ func TestState(t *testing.T) { st.skipFork("Magneto") st.skipFork("London") } + // The multigeth data type (like the Ethereum Foundation data type) doesn't support + // the ETC_Mystique fork/feature configuration, which omits EIP1559 and the associated BASEFEE + // opcode stuff. This configuration cannot be represented in their struct. if os.Getenv(CG_CHAINCONFIG_FEATURE_EQ_MULTIGETHV0_KEY) != "" { st.skipFork("ETC_Mystique") } From 09fb6f981ff8684b217736f63fa45778eb7c1ed9 Mon Sep 17 00:00:00 2001 From: meows Date: Tue, 4 Jan 2022 05:21:59 -0800 Subject: [PATCH 5/5] tests: add forgotten skip for the external EVMs for Mystique Date: 2022-01-04 05:21:59-08:00 Signed-off-by: meows --- tests/state_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/state_test.go b/tests/state_test.go index 071a2c4b726a..75d7f8deac7e 100644 --- a/tests/state_test.go +++ b/tests/state_test.go @@ -66,9 +66,10 @@ func TestState(t *testing.T) { if *testEVM != "" || *testEWASM != "" { // Berlin tests are not expected to pass for external EVMs, yet. // - st.skipFork("^Berlin$") - st.skipFork("Magneto") - st.skipFork("London") + st.skipFork("^Berlin$") // ETH + st.skipFork("Magneto") // ETC + st.skipFork("London") // ETH + st.skipFork("Mystique") // ETC } // The multigeth data type (like the Ethereum Foundation data type) doesn't support // the ETC_Mystique fork/feature configuration, which omits EIP1559 and the associated BASEFEE