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

Merge/foundation release/1.10.21 tests generate #496

Merged
merged 3 commits into from
Sep 5, 2022

Conversation

meowsbits
Copy link
Member

@meowsbits meowsbits commented Aug 16, 2022

  • updates the cross-client test suites to use the latest version per upstream ethereum/go-ethereum as reference
  • updates and occasionally fixes cross-client test generation logic

notes

  • LegacyTests are now a submodule of the tests/testdata submodule, forked here https://github.com/etclabscore/legacytests
    • checkouts now need to be sure to use git submodule update --recursive [--init]
    • this is a change from upstream
  • todos and comments will be marked inline in the patch view below

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")
Copy link
Member Author

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_mgen_test.go Outdated Show resolved Hide resolved
tests/state_mgen_test.go Outdated Show resolved Hide resolved
return nil, nil, common.Hash{}, fmt.Errorf("%w: toMessage: %v", err, t.json.Tx)
}

// Try to recover tx with current signer
Copy link
Member Author

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.

@meowsbits meowsbits force-pushed the merge/foundation-release/1.10.21-tests-generate branch from 9e4a584 to edcedda Compare August 17, 2022 13:28
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 <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

tests: (experiment) remove test runner gasprice=1 default

Date: 2022-08-17 07:39:20-05:00
Signed-off-by: meows <b5c6@protonmail.com>

tests: refactor and clean up code (noop)

Date: 2022-08-17 07:37:28-05:00
Signed-off-by: meows <b5c6@protonmail.com>

make.test.out:

Date: 2022-08-16 17:53:18-05:00
Signed-off-by: meows <b5c6@protonmail.com>

tests: generate state tests w/ no fails

Date: 2022-08-16 17:52:14-05:00
Signed-off-by: meows <b5c6@protonmail.com>

tests: again, again, fixup maybe the stupid test thingy

Date: 2022-08-16 17:08:29-05:00
Signed-off-by: meows <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

tests: generate state tests

Date: 2022-08-16 15:54:39-05:00
Signed-off-by: meows <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

tests: fix error handling/tx types for London:Mystique test gen

Date: 2022-08-16 15:00:09-05:00
Signed-off-by: meows <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

tests: generate tests, bump submodule

Date: 2022-08-16 14:06:27-05:00
Signed-off-by: meows <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

generate state tests again

This writes now to the new LegacyTests submodule.

Signed-off-by: meows <b5c6@protonmail.com>

tests: update testdata submodule to generated state test version

Date: 2022-08-16 09:56:20-05:00
Signed-off-by: meows <b5c6@protonmail.com>

:eyeglasses: :pen:

Signed-off-by: meows <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

tests: add more expected failures for accessLists

Date: 2022-08-16 08:57:25-05:00
Signed-off-by: meows <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

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 <b5c6@protonmail.com>

tests: difficulty tests to use BasicTests dir (not .core-geth)

Date: 2022-08-16 08:20:50-05:00
Signed-off-by: meows <b5c6@protonmail.com>

tests: rm dead code

Date: 2022-08-17 08:29:30-05:00
Signed-off-by: meows <b5c6@protonmail.com>
@meowsbits meowsbits force-pushed the merge/foundation-release/1.10.21-tests-generate branch from edcedda to 2afd721 Compare August 17, 2022 13:30
Date: 2022-08-17 09:02:52-05:00
Signed-off-by: meows <b5c6@protonmail.com>

remove dead code

Signed-off-by: meows <b5c6@protonmail.com>
@meowsbits meowsbits force-pushed the merge/foundation-release/1.10.21-tests-generate branch from 1433d40 to 4b1b83c Compare August 17, 2022 14:03
This avoids issues keeping these logics
in lockstep by hand better.

Date: 2022-08-17 09:13:35-05:00
Signed-off-by: meows <b5c6@protonmail.com>
Base automatically changed from merge/foundation-release/1.10.21 to master September 5, 2022 16:16
Copy link
Member

@ziogaschr ziogaschr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@meowsbits meowsbits merged commit 84be258 into master Sep 5, 2022
@meowsbits meowsbits deleted the merge/foundation-release/1.10.21-tests-generate branch September 5, 2022 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants