-
Notifications
You must be signed in to change notification settings - Fork 319
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
make a difficulty blockchain tests separated and genesis block > 0 #318
Comments
Supporting a "genesis" state with block number > 0 is easiest for clients that already support a "snapshot import" (where the snapshot is a json list of accounts ethereum/EIPs#227), which I think is only pyethereum. It would be best if clients added support for importing a state snapshot as a way to sync to the mainnet (i.e. a user exposed feature). Then the new test format is the same as the json state snapshot format, and could be used with Hive clients as a black-box test runner (rather than clients adding custom unit-testing hooks). |
In a whitebox/custom test setting, it would be pretty simple, I should think. Don't think we could do it through hive, though |
Having non-zero genesis to signal special sealing mode looks like a hack, why couldn't we just have a special setting in tests to enable/disable mining? |
right we could have a special setting in a config json file to signal that mining difficulty should be checked. no need to change smth on hive. this should be done on clients when starting node. |
@winsvega can we separate genesis != 0 and NoProof in two different issues? |
yes. so lets say if blockchaintest.json has "sealEngine" : "NoProof" then difficulty should not be calculated. |
Curren approach is to dave difficulty formula tests
|
another issue with disabling mining on blockchain tests. as @holiman said such tests would not then be blind and we can't port them to Hive. I guess this issue could be closed and resolved with
|
What is the state of difficulty tests for Constantinople? Is it worth wait for that and will there be an additional If this is too much workload, maybe someone else can help out here? |
Yes.additional basic tests will be. |
At the moment regenerating blockchain tests for Constantinople |
@winsvega Cool, thanks for the update! |
@holiman at this point we have difficulty checked even with NoProof rules in a blockchain tests. I think we dont really have to support genesis > 0 if we just check the difficulty. |
I actually happened to look into that a while back, because I wanted to be able to run |
difficulty hash field checks are disabled. the difficulty formula is still verified but with no proof. |
Currently all blockchain tests are using mining to calculate the correct difficulty for the block.
however we only need a set of tests for the difficulty rules and other tests could just skip mining and difficulty check. switch to noProof rules.
this should increase the speed of blockchain tests generation by x100 times.
to test the difficulty we will be using new set of tests in blockchain tests format
which will have genesis block != 0 so that we could test difficulty formula on any block number on any fork network rules.
The idea
*an uncle from <= genesis block number - 1 is not allowed.
*any opcode calls to genesis block number -1 are not allowed
or you could suggest the other format to enable / disable difficulty check on blockchain tests
The text was updated successfully, but these errors were encountered: