Open winsvega opened 1 month ago
to reproduce
make a test with this bytecode
def test_blockhash_bug(state_test: StateTestFiller, pre: Alloc):
"""
comment
"""
contract = pre.deploy_contract(code=Op.BLOCKHASH(0))
tx = Transaction(
sender=pre.fund_eoa(),
gas_limit=500_000_000,
gas_price=10,
to=contract,
data=b"",
value=0,
protected=False,
)
state_test(env=Environment(), pre=pre, post={}, tx=tx)
here is the evmdump http://retesteth.ethdevops.io/temp/pyspecs/frontier__scenarios__test_scenarios__test_blockhash_bug/
if a state test mode uses blockhash opcode it should be a blockchain test as we agreed to remove fake hash caluclations from t8n
I object to this. Removing an opcode from statetests means that randomly generated statetests are no longer possible to execute across different clients. I don't care what it returns, as long as all clients return the same thing. Right now, they do. Why change that? It's a trivial function.
hm. yes I see we had discussion about this. the concern is that such test cover this artificial logic of computing the hash. and we wanted to move it all to blockchain test format only to avoid that. otherwise we need to force everyone to maintain hash calculation for state tests according to this formula. ah and it seems evmone didn't like that. so yes we try to avoid using blockchain opcodes in state tests. if so we make it a blockchain test.
I found the issue of at least one of the cases the eels resover reports an error
so if a state test uses blockhash opcode it causes pydantic to panic and eels resolver makes issues in the logs. which is actually we should report an error. if a state test mode uses blockhash opcode it should be a blockchain test as we agreed to remove fake hash caluclations from t8n