-
Notifications
You must be signed in to change notification settings - Fork 334
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
Blake2f test vectors #619
Blake2f test vectors #619
Conversation
src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLCODEBlake2fFiller.json
Outdated
Show resolved
Hide resolved
"expect": [ | ||
{ | ||
"indexes": { | ||
"data": [0], |
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.
also a comment about what is the case on data 0
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.
described the outputs in the "// data" section, they are all hash values so they are quite opaque.
src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json
Outdated
Show resolved
Hide resolved
src/GeneralStateTestsFiller/stPreCompiledContracts2/CALLBlake2fFiller.json
Outdated
Show resolved
Hide resolved
Is there some sort fo a standard published as to what is expected from a community contributed test case? These objections seem arbitrary when I can point to other tests cases that don't have these features. While it is valid to say "past bad behavior does not set a precedent" without a clear document describing what is expected all I have are the past behaviors and I don't know which are bad, which are acceptable, and which are good. |
hm. no such standard created yet. good point this notes is well to be published in test creation wiki. and also non of the external contributors mostly ever wrote any .json tests to the repo. so thats why no manuals. now when other clients could write their own tests the manuals are to be created from precedents |
* add input data descriptions * add new tests for input length and round extremes (0, max)
Also added a few more test cases. Also, we should have cross comparison against another before committing. Some details are not settled yet that are covered by these test cases. |
Stay in touch. Once geth have the implementation you could run this test against two clients |
This may not be the best discussion forum, but one thing that struck me is that it would be neat if all[*] tests use the [*] |
It totally demolishes gas calculation comparison because all the fees go right back where they started. Perhaps the contract becomes the coinbase? But then you would have to explain why the contract's balance goes up in the same way the coinbase would go up. |
Ah, that's true. So I guess the trick is not really that nifty, unless we explicitly want to avoid letting gas calc be part of the test.
|
Geth doesn't pass these tests...
Question: is this PR up to date? |
Should be up to date. What does a retesteth run at --verbosity 6 say? Given that this is a state root mismatch and not off the filler it could be many things. |
Also to see the post state |
Is this off of develop/head? I don't think the contract is firing as there is nothing stored in storage - https://gist.github.com/shemnon/adf5b5d24f05aadbbcd2272405b1c3e0 |
The precompiled must be supported by the client implementation. You use Pantheon ? |
Yes, Pantheon (as it currently is named). it's an internal build off of head. |
The failing vectors are d = {0,1,2,6}, which are all the bad data failure cases. All the "good data" cases are passing. Geth has ending balance of 999999999999901559711 for 0,1, and 2 whereas pantheon has multiple balances (caused by intrinsic tx cost changes) of around 999999999999999954832 (at gas 0). Pantheon charges 45,168 wei for this bad call and Geth 98,440,289 at gas 0 and the full limit at gas 1, 2, and 3. When the precompile fails due to validation is the correct failure mode to fail the call or to fail the whole tx and charge the gas limit? |
I am afraid geth didn't implement the contract yet. If so then its just a call to empty address. If the precompile is implemented but fails then it just eat the whole gas. If the precompile works need to check the results againt other clients. (By putting the results into storage) |
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.
please add expect section for uncovered transactions
and refill with latest retesteth (ethereum/retesteth#48)
and with latest lllc version
rebase on tests:develop to fetch the retesteth config first
Run with the new LLLC Also, add Istanbul genesis config
I think the no TXes complaint is from the lack of the Istanbul config. I pulled over the one I had in place for Martin's changes. |
hmm. how you created this tests? did you get any errors?
meaning there are some transactions that does not have post condition checks |
# Conflicts: # Retesteth/default/genesis/Istanbul.json
|
No. I don't understand why. the tests state that retesteth used commit is from master branch. but the behaviour of your retesteth is way outdated. It is filling the blockchain tests into a wrong folder name. and it does not perform the state test validity check. could you double check that you running the tool on latest commit from the master branch? |
at @eeb4805 I get a whole lot of |
lllc version is hand fed because the lllc version logic is broken on retesteth on a mac. |
this is very strange. you must at least see this errors:
how you deal with lllc version problem ? |
I don't see those errors, never have. I hand edited the LLLC versions into the JSON. I think there is some problems with the way you detect if LLLC is present on mac. |
I've just compiled lllc and retesteth on mac and created a test for it: the build went through just fine. smth is wrong on your end.
You can't just edit those fields. You provide misinformation about the test. If smth went wrong with lllc then the test is not filled correctly. lllc version is only a warning if when you fill the tests there is no lllc code in the test. |
LLLC version - when I put the LLLC setting in the exported environment instead of as a shell parameter the error stops occuring. You will note the version is exactly the same as was copied in by hand. ethereum/retesteth#52 version includes the v,s,r values that were complained about in another thread. So I re-ran the tests to get those in the blockchain tests. The transaction errors are flakey, so I think it's something inside of retesteth. I think it is a timing issue as I didn't see them until today and I see them less than 10% or the time and only under load (running a compile in another thread or some ad-filled chrome webpage). The JSON-RPC traces are mostly the same, except that a success will continue with more JSON-RPCs to do the fill. https://gist.github.com/shemnon/72cd75520148dc546e995e63a5ecd938 Have you tried to local test against geth or besu and do you see the same errors consistantly? |
yes the process is fully deterministic. how can I build pantheon/besu on ubuntu? |
The full version is here. The short version for this case is
|
"9 - RFC 7693 Appendix-A, 8 million rounds" | ||
], | ||
"data": [ | ||
"0x", |
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.
Another test suggestion: non-empty data, but fewer than 4 bytes, to catch possible errors of trying to calculate the precompile cost out of it
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.
added as data 10
Two things (a) the docs and errors were not particularly clear that all permutations must be covered. The error message could be re-tooled to communicate this better
(b) This error must be produced all the time on all platforms. I only rarely see it on my macbook pro, and then only when I put the system under load. This feels like a memory fencing or threading issues, like data is getting overwritten before it is moved to a more permanent location. |
(b) the error is added to error list upon test execution. then all errors from the list are stdeerored once threads are merged. so the output is done at the main thread. |
I don't know how it's possible, but I have observed that it does occur. Perhaps a memory fence needs to be raised prior to the data check? |
Add CALL and CALLCODE tests for the standard unit test vectors for Blake2F, targeting Istanbul.