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

VM: Update Ethereum/tests Submodule #1116

Merged
merged 7 commits into from
Feb 18, 2021
Merged

VM: Update Ethereum/tests Submodule #1116

merged 7 commits into from
Feb 18, 2021

Conversation

holgerd77
Copy link
Member

@holgerd77 holgerd77 commented Feb 16, 2021

Ok, this is one of the last big tasks needed both for a client and a berlin/Yolo VM release.

This shouldn't be underestimated since the last integration is somewhat long ago (66a55cd from July 13, 2020) and there were countless changes in the ethereum/tests repo. We can get some orientation here from the release notes in the v7.0.1 release, this likely not covers all the changes along though since our last internal integration (update: ah, maybe the release does include all the changes since our latest release).

With this v7.0.1release the situation will get better though since there now will be regular releases on the tests repo we can follow along with. 🙂 🎉

I think the best chance we have to approach this systematically is to go a few (dozen) commits from ethereum/tests with every commit here and see if things still work. Otherwise we will just drag in too much changes at once and will get lost. We will have - for sure - to adopt our test structure along the way and eventually also fix some bugs from the tests itself.

I'll prepare a corresponding table a start with a first commit just staying on the same initial ethereum/tests state mentioned above but trigger all the additional tests with our type: test all hardforks label (which we haven't used in a while).

Phew. Let's start. 😀

Ethereum/tests Date Commit  Description Work Status
66a55cd (PR #715) 2020-07-13 462a920  Initial state, but here with all HFs tested
176f8cc (PR #723) 2020-10-27 71bbeae  Complete refill 729, opcode tests 731 and following, gas cost tests 738, Complete test refill 723 Corrected istanbul, muirGlacier test number in c55bf0d, berlin state + BC tests failing, ignoring for now
392b27e (PR #750) 2020-10-31 1fd6a77  Code related tests 744, code gas price tests 745, CREATE2 result tests 746, out of gas in RETURN and REVERT 749, All passing except Berlin -> continue
16e239a (PR #767) 2020-12-03 e2d7475  Berlin updates/fixes 752,753, EIP-2929 tests 756,757,760, buffer + other tests 761-766 All passing after b669496 -> continue
1fcd4e5 (PR #779) 2021-02-02 - Constantinope transition 768, vmArithmetic tests 771, Yolo v3 775, removed EIP-2537 776  Open

Note:

  1. Numbers without # are PR references to Ethereum/tests
  2. Changes in "Description" from old to new (based on merge dates)

Everyone invited here to continue working on this.

@holgerd77 holgerd77 added type: tests prio: P2 very important package: vm type: test all hardforks This special label enables VM state and blockchain tests for all hardforks on the respective PR. labels Feb 16, 2021
@codecov
Copy link

codecov bot commented Feb 16, 2021

Codecov Report

Merging #1116 (7ca74a7) into master (e1ffc7f) will decrease coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

Flag Coverage Δ
block 81.65% <ø> (ø)
blockchain 84.13% <ø> (ø)
client 86.84% <ø> (-0.23%) ⬇️
common 87.21% <ø> (ø)
devp2p 84.25% <ø> (-0.24%) ⬇️
ethash 82.08% <ø> (ø)
tx 91.93% <ø> (-0.13%) ⬇️
vm 83.05% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@holgerd77
Copy link
Member Author

Ah, ok, e2d7475 finally triggered something (I was already starting to feel uneasy thinking I might be totally overdoing here. 😜 Generally this went better than I expected though up-till-now).

So the Homestead blockchain test run is failing (again: ignore the Berlin tests for now, we can tackle this separately in a new PR), here is an extract:

ok 6332 correct pre stateRoot
ok 6333 Expected exception InvalidStateRoot
ok 6334 correct last header block
# file: nonceWrong test: nonceWrong_Homestead
ok 6335 SealEngine setting is not matching chain consensus type, skip test. # SKIP
ok 6336 correct genesis RLP
ok 6337 correct pre stateRoot
Error: invalid POW
    at /home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/blockchain/src/index.ts:887:19
    at Blockchain.runWithLock (/home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/blockchain/src/index.ts:407:21)
    at Blockchain._putBlockOrHeader (/home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/blockchain/src/index.ts:851:5)
    at Blockchain.putBlock (/home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/blockchain/src/index.ts:806:5)
    at runBlockchainTest (/home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/vm/tests/BlockchainTestsRunner.ts:127:7)
    at /home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/vm/tests/tester.ts:172:19
    at fileCallback (/home/runner/work/ethereumjs-monorepo/ethereumjs-monorepo/packages/vm/tests/testLoader.ts:60:11)
not ok 6338 Error: invalid POW

@holgerd77
Copy link
Member Author

This is likely coming from the "buffer + other tests 761-766" part, other tests are Berlin/Yolo only.

@evertonfraga
Copy link
Contributor

@holgerd77 for cases like this one, where you need to test until which specific commit things were working, there's git bisect. You can define a set of tasks that are executed for every commit, and it automatically does a binary search to get the most recent working version, and returns that to you.

if you need anything, LMK!

@holgerd77
Copy link
Member Author

Hmm, a bit strange, I did some isolated test run here with:

ts-node ./tests/tester --blockchain --fork=Homestead --file='nonceWrong'

(Attention! The --fork parameter really needs to be passed in with a capital letter, first stumbled upon this one)

This gives the following output and the test then passes:

+--------------------------------------------------+
| VM -> BlockchainTests                            |
|                                                  |
| TestGetterArgs                                   |
| skipTests           : 51                         |
| forkConfig          : Homestead                  |
| file                : nonceWrong                 |
|                                                  |
| RunnerArgs                                       |
| forkConfigVM        : homestead                  |
| forkConfigTestSuite : Homestead                  |
| common              : homestead                  |
+--------------------------------------------------+

TAP version 13
# BlockchainTests
# file: nonceWrong test: nonceWrong_Homestead
ok 1 SealEngine setting is not matching chain consensus type, skip test. # SKIP
ok 2 correct genesis RLP
ok 3 correct pre stateRoot
ok 4 Expected exception InvalidBlockNonce
ok 5 correct last header block

1..5
# tests 5
# pass  5

# ok

So might be a hint that there is rather some failure in the test setup and eventually some parameter from a previous test run is not cleaned up correctly or something? 🤔

…e transition, vmArithmetic tests, Yolo v3, removed EIP-2537)
@holgerd77
Copy link
Member Author

Ah ok, all passing, with a small fix. 😄

This is now ready for review. Very much think we can merge, and then we can address fixing the Berlin tests separately.

Istanbul: 10759,
MuirGlacier: 10759,
Istanbul: 10715,
MuirGlacier: 10715,
Copy link
Member

Choose a reason for hiding this comment

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

Any reason why the amount of tests here have decreased?

Copy link
Member Author

Choose a reason for hiding this comment

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

TBH: these number checks are totally out of work anyhow, noticed this after the changes here. Istanbul actually has 11632 checks - see the respective run. But the checks are not enforced and - furthermore - we also have this double structure with redundant test numbers being both in the config.ts and the CI workflow files in CI.

Don't know - I would have a tendency to fix this separately (or at least - to be plain honest - I am not motivated to do this here along this PR atm).

Copy link
Contributor

@cgewecke cgewecke left a comment

Choose a reason for hiding this comment

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

Looks good!

@holgerd77 holgerd77 merged commit 27d6433 into master Feb 18, 2021
@holgerd77 holgerd77 deleted the update-ethereum-tests branch February 18, 2021 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vm PR state: needs review prio: P2 very important type: test all hardforks This special label enables VM state and blockchain tests for all hardforks on the respective PR. type: tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants