-
Notifications
You must be signed in to change notification settings - Fork 163
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
Merge/foundation release/1.10.21 tests generate #496
Merge/foundation release/1.10.21 tests generate #496
Conversation
tests/init_test.go
Outdated
difficultyTestDir = filepath.Join(baseDir, "BasicTests.core-geth") | ||
benchmarksDir = filepath.Join(".", "evm-benchmarks", "benchmarks") | ||
// difficultyTestDir = filepath.Join(baseDir, "BasicTests.core-geth") | ||
difficultyTestDir = filepath.Join(baseDir, "BasicTests") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO.
(Difficulty tests are often core-geth specific because core-geth has lots of logic for difficulties that don't care about the difficulty bomb. A separate dir was used, if I remember right, because they were removed or deprecated upstream... possibly with the "Legacy"/"Constantinople" labels and partitioning that happened upstream a while ago).
tests/state_test_util.go
Outdated
return nil, nil, common.Hash{}, fmt.Errorf("%w: toMessage: %v", err, t.json.Tx) | ||
} | ||
|
||
// Try to recover tx with current signer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This now matches the logic from RunNoVerify
. This stanza was added upstream and since this function is specific to core-geth, it was missing. types.LatestSigner
should always be able to recover the signer for all tx types and configs.
9e4a584
to
edcedda
Compare
Tests are generated on top of the latest ethereum/go-ethereum suite version: a380655. tests: tidy up code Date: 2022-08-17 08:17:36-05:00 Signed-off-by: meows <[email protected]> tests: generate state subtests This run was run against a clean version of the upstream versions. It passed all tests first try. A keeper. Date: 2022-08-17 08:06:32-05:00 Signed-off-by: meows <[email protected]> tests: (experiment) remove test runner gasprice=1 default Date: 2022-08-17 07:39:20-05:00 Signed-off-by: meows <[email protected]> tests: refactor and clean up code (noop) Date: 2022-08-17 07:37:28-05:00 Signed-off-by: meows <[email protected]> make.test.out: Date: 2022-08-16 17:53:18-05:00 Signed-off-by: meows <[email protected]> tests: generate state tests w/ no fails Date: 2022-08-16 17:52:14-05:00 Signed-off-by: meows <[email protected]> tests: again, again, fixup maybe the stupid test thingy Date: 2022-08-16 17:08:29-05:00 Signed-off-by: meows <[email protected]> tests: yet another patch to figure out the new exception handling biz Date: 2022-08-16 16:15:13-05:00 Signed-off-by: meows <[email protected]> tests: generate state tests Date: 2022-08-16 15:54:39-05:00 Signed-off-by: meows <[email protected]> tests: fixup previous commit; I forgot the post data besides the exception Date: 2022-08-16 15:01:13-05:00 Signed-off-by: meows <[email protected]> tests: fix error handling/tx types for London:Mystique test gen Date: 2022-08-16 15:00:09-05:00 Signed-off-by: meows <[email protected]> tests: (wip) generate state tests again These FAILED but with the 'transaction type not supported' for a London:Mystique conversion. Date: 2022-08-16 14:35:34-05:00 Signed-off-by: meows <[email protected]> tests: fix gen function to copy the new TxBytes post state field These were missing, apparently inconsequentially, but now they seem to be where they should be. Date: 2022-08-16 14:26:41-05:00 Signed-off-by: meows <[email protected]> tests: handle expected exceptions for test filling stTransactionTest/ValueOverflow.json was failing because it expects an exception, but the parse error was getting thrown like it was unexpected. Now the gen functions handle ExpectExceptions better and the issue is not an issue anymore. Date: 2022-08-16 14:25:00-05:00 Signed-off-by: meows <[email protected]> tests: generate state tests, bump submodule fixes gasprice issue cited in previous commit Date: 2022-08-16 14:07:26-05:00 Signed-off-by: meows <[email protected]> tests: generate tests, bump submodule Date: 2022-08-16 14:06:27-05:00 Signed-off-by: meows <[email protected]> tests: set test Tx gasPrice if not set ETC_Mystique does not adopt EIP1559. Thus, it does not configure baseFee, and txes require gas prices. An example test (stBadOpcode/opc0CDiffPlaces.json) does not configure gas price. So we set a default as 1 in case the value is not set. This allows the test data to get parsed toMesssage properly, and we can generate the tests right. Date: 2022-08-16 13:39:57-05:00 Signed-off-by: meows <[email protected]> generate state tests again This writes now to the new LegacyTests submodule. Signed-off-by: meows <[email protected]> tests: update testdata submodule to generated state test version Date: 2022-08-16 09:56:20-05:00 Signed-off-by: meows <[email protected]> :eyeglasses: :pen: Signed-off-by: meows <[email protected]> tests: use .ExpectException instead of handrolling expections This field was added somewhat recently, and is already implemented in the state_test.go file and runner. Date: 2022-08-16 09:03:53-05:00 Signed-off-by: meows <[email protected]> tests: add more expected failures for accessLists Date: 2022-08-16 08:57:25-05:00 Signed-off-by: meows <[email protected]> tests: skip accessList tests for Homestead The command 'make tests-generate-state' paniced: --- PASS: TestGenStateAll/testdata/GeneralStateTests/stEIP3607/transactionCollidingWithNonEmptyAccount_send.json (0.00s) --- PASS: TestGenStateAll/testdata/GeneralStateTests/stEIP3607/transactionCollidingWithNonEmptyAccount_send.json/ETC_Mystique/0/trie (0.00s) --- PASS: TestGenStateAll/testdata/GeneralStateTests/stEIP3607/transactionCollidingWithNonEmptyAccount_send.json/London/0/trie (0.00s) --- FAIL: TestGenStateAll/testdata/GeneralStateTests/stExample/accessListExample.json (0.01s) --- PASS: TestGenStateAll/testdata/GeneralStateTests/stExample/accessListExample.json/ETC_Agharta/0/trie (0.00s) --- PASS: TestGenStateAll/testdata/GeneralStateTests/stExample/accessListExample.json/ETC_Agharta/1/trie (0.00s) --- FAIL: TestGenStateAll/testdata/GeneralStateTests/stExample/accessListExample.json/Homestead/0/trie (0.00s) panic: transaction type not supported [recovered] panic: transaction type not supported goroutine 72552 [running]: testing.tRunner.func1.2({0xb07800, 0xc00007a8b0}) /home/ia/go1.18.3.linux-amd64/src/testing/testing.go:1389 +0x24e testing.tRunner.func1() /home/ia/go1.18.3.linux-amd64/src/testing/testing.go:1392 +0x39f panic({0xb07800, 0xc00007a8b0}) /home/ia/go1.18.3.linux-amd64/src/runtime/panic.go:838 +0x207 github.com/ethereum/go-ethereum/tests.(*testMatcherGen).stateTestRunner.func1(0xc000821d40) /home/ia/go/src/github.com/ethereum/go-ethereum/tests/state_mgen_test.go:331 +0x209 testing.tRunner(0xc000821d40, 0xc0004ab1a0) /home/ia/go1.18.3.linux-amd64/src/testing/testing.go:1439 +0x102 created by testing.(*T).Run /home/ia/go1.18.3.linux-amd64/src/testing/testing.go:1486 +0x35f FAIL github.com/ethereum/go-ethereum/tests 293.108s FAIL Makefile:101: recipe for target 'tests-generate-state' failed make: *** [tests-generate-state] Error 1 Date: 2022-08-16 08:44:48-05:00 Signed-off-by: meows <[email protected]> params/coregeth.json.d,tests: make tests-generate-difficulty; yields testdata 78c4480bab Date: 2022-08-16 08:24:16-05:00 Signed-off-by: meows <[email protected]> tests: difficulty tests to use BasicTests dir (not .core-geth) Date: 2022-08-16 08:20:50-05:00 Signed-off-by: meows <[email protected]> tests: rm dead code Date: 2022-08-17 08:29:30-05:00 Signed-off-by: meows <[email protected]>
edcedda
to
2afd721
Compare
Date: 2022-08-17 09:02:52-05:00 Signed-off-by: meows <[email protected]> remove dead code Signed-off-by: meows <[email protected]>
1433d40
to
4b1b83c
Compare
This avoids issues keeping these logics in lockstep by hand better. Date: 2022-08-17 09:13:35-05:00 Signed-off-by: meows <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
notes
tests/testdata
submodule, forked here https://github.com/etclabscore/legacytestsgit submodule update --recursive [--init]