-
Notifications
You must be signed in to change notification settings - Fork 2.2k
blockhash always returns zero in solidity tests for constantinople #5184
Comments
Pre-deploying the blockhash contract during genesis seems to help, but caused other complications for our tests, so we will postpone this issue and disable the blockhash test for constantinople for now. |
To summarize what we discussed verbally:
|
Can you move the feature to "experimental" chain config that is after the Constantinople. I remember we discussed creating it. |
I'll move it, that config already exists, I moved EIP86 account abstraction into it. |
I was not sure. 👍 |
If constantinople block is 0 you could hardcode that genesis state has this blockhash contract by default. As we do not have a standart of adding precompiled contracts with genesis config (and we dont have a standart of genesis config itself) I say all hardfork feautures should be hardcodede then. and triggered by hardfork block number. |
BLOCKHASH refactoring moved to "exerimental" fork, @ekpyron please check that it solved your issue |
Is this fixed by #5225 ? |
@ekpyron won't be back before next week and I don't know where he had the issue. |
Hm. The issue was that we added a It looks like with current develop I get the last 255 hashes, whereas with "solidity tester" I get the last 256 hashes. Furthermore there seems to be an offset of one.
|
What we do is to run the solidity code in https:/ethereum/solidity/blob/410d288dfc2e08c42df58c7e01ad5c332ce92727/test/libsolidity/SolidityEndToEndTest.cpp#L3049 and to compare with |
Seems that we get different bock numbers than before. I'll recheck whether I can find out why that is. |
I'm closing this one, since |
@ekpyron |
wait when it was mining more blocks then asked? |
I don't know if it did in practice, but it certainly could - checking how many we mined + stopping mining was not atomic. (Actually I saw this happening but not with the RPC method, but with another similar method in unit tests) |
I created ethereum/solidity#4951 for the changes needed in solidity for the tests to work against recent aleth - it seems like the block numbers are different, but actually make more sense than before... |
In ethereum/solidity#4799 we introduce semantics tests for
blockhash()
in solidity, but the blockhash opcode always returns zero in our tests when setting the EVM version to constantinople.This may be related to #4066 and may also just be a problem in solidity's test setup.
In the solidity tests the constantinople fork block is set to zero (https:/ethereum/solidity/blob/43db88b8363d73ee2f5ffa094ff506414261bd11/test/RPCSession.cpp#L238) and we rewind the chain to block zero before every test (https:/ethereum/solidity/blob/43db88b8363d73ee2f5ffa094ff506414261bd11/test/ExecutionFramework.cpp#L59).
The text was updated successfully, but these errors were encountered: