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

[WIP] Run with the latest tests #305

Closed
wants to merge 3 commits into from
Closed

Conversation

holgerd77
Copy link
Member

Updated ethereumjs-testing to v1.2.0 (submodule 428842e)

@holgerd77
Copy link
Member Author

holgerd77 commented Jun 22, 2018

Very modest result, one new failing test:
ecmul_0-3_5616_28000_96

Run with:

node tests/tester.js -s --test='ecmul_0-3_5616_28000_96'

Filler | Test

Output:

$ node tests/tester.js -s --test='ecmul_0-3_5616_28000_96'
TAP version 13
# GeneralStateTests
# file: ecmul_0-3_5616_28000_96 test: ecmul_0-3_5616_28000_96
not ok 1 the state roots should match
  ---
    operator: equal
    expected: |-
      '631a600601a67ef3357813281d417e141e5eddf306abd4d8824bdc141536e3c6'
    actual: |-
      '261abab5092a666776b6e956e2d572769b5cfef2fcff383ae956fcc75e36e133'
    at: replenish (/Users/hdrewes/Documents/DEV/EthereumJS/ethereumjs-vm/node_modules/async/dist/async.js:1011:17)
  ...
ok 2 the state roots should match
ok 3 the state roots should match
ok 4 the state roots should match

1..4
# tests 4
# pass  3
# fail  1

This is the one with the highest gas limit (taking 20000 from "gasLimit": [ "0xcaf8", "90000", "110000", "200000"]) - so d:0, g:3, v:0 - and so probably the test that is running through respectively would have enough gas to not run out of gas.

This is probably failing relatively early, since --jsontrace gives no output while testing on other d,g,v combination does.

This is going into this conditional statement with the following message (hidden):

sender doesn't have enough funds to send tx. The upfront cost is: 200000 and the sender's account only has: 150000

Run the single test case:

node tests/tester.js -s --test='ecmul_0-3_5616_28000_96' --data=0 --gas=3 --value=0 --jsontrace

This is probably failing due to some generic VM behavior and not due to problems with the corresponding precompile.

@holgerd77 holgerd77 force-pushed the update-tests-v120 branch from bd01124 to ee7ae31 Compare July 11, 2018 08:05
@holgerd77
Copy link
Member Author

Just rebased this.

@holgerd77 holgerd77 force-pushed the update-tests-v120 branch from ee7ae31 to fb35918 Compare July 20, 2018 11:20
@holgerd77
Copy link
Member Author

Rebased this, as a negative test for #313.

@axic
Copy link
Member

axic commented Jul 20, 2018

Fails on:

# file: ecmul_0-3_5616_28000_96 test: ecmul_0-3_5616_28000_96
not ok 4554 the state roots should match
  ---
    operator: equal
    expected: |-
      '631a600601a67ef3357813281d417e141e5eddf306abd4d8824bdc141536e3c6'
    actual: |-
      '261abab5092a666776b6e956e2d572769b5cfef2fcff383ae956fcc75e36e133'
    at: replenish (/home/circleci/project/ethreumjs-vm/node_modules/async/dist/async.js:998:17)
  ...

@axic
Copy link
Member

axic commented Jul 20, 2018

This may be fixed with my update to rustbn.js to use ethereum-bn128.rs?

@holgerd77
Copy link
Member Author

@axic No, not fixed. Same test ecmul_0-3_5616_28000_96 failing.

@holgerd77 holgerd77 force-pushed the update-tests-v120 branch from 5f90023 to c3261a5 Compare July 23, 2018 18:53
@holgerd77
Copy link
Member Author

Rebased this, mainly for the reason to have this also run with the Constantinople tests for a first impression (see #317).

@holgerd77
Copy link
Member Author

Will remove the rustbn.js commit, this is breaking the build.

@holgerd77 holgerd77 force-pushed the update-tests-v120 branch from c3261a5 to 732e551 Compare July 23, 2018 19:07
@axic
Copy link
Member

axic commented Jul 23, 2018

Will remove the rustbn.js commit, this is breaking the build.

The reason it was breaking is because it pointed to a branch (PR), but that was merged and deleted. Lets try again with master.

@axic axic force-pushed the update-tests-v120 branch from ee98c65 to 3f28330 Compare July 23, 2018 20:32
@axic
Copy link
Member

axic commented Jul 23, 2018

While the precompile cleanup doesn't fix the problem, I think they should be merged. Created #318.

@axic
Copy link
Member

axic commented Jul 24, 2018

Debugging the ecmul issue locally.

@axic
Copy link
Member

axic commented Jul 24, 2018

In the test case the input data is

0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000330644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000000000000000000000000000000000000000000000000000000000000000000000

And rustbn.js returns empty output, which means it considers it a failure.

To me that seems it has a curve point (0, 0) data (infinity...) multiplied with that large constant and has stray trailing data.

Update: this is the actual data properly decoded:

x: 0000000000000000000000000000000000000000000000000000000000000000
y: 0000000000000000000000000000000000000000000000000000000000000003
scalar: 30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000000
stray: 0000000000000000000000000000000000000000000000000000000000000000

To this paritytech/bn says it is an invalid curve point. Is any other client passing this test?

Unfortunately only having hashes for state tests doesn't give any idea what it is expecting.

Here is the test source: https://github.com/ethereum/tests/blob/0eef2f31ab59016a7ccad2a99d4644f753eebcb9/src/GeneralStateTestsFiller/stZeroKnowledge2/ecmul_0-3_5616_28000_96Filler.json

Since it has an EVM blob I am not sure what it is intended to do. @winsvega any ideas? Are there any sources to those EVM blobs?

@axic axic force-pushed the update-tests-v120 branch from a7b9bdd to a03ca46 Compare July 24, 2018 11:15
@axic
Copy link
Member

axic commented Jul 30, 2018

@holgerd77 we would need to update our test repo after ethereum/tests#477. I would like to verify if the bitwise stuff still works.

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.

3 participants