Closed qzhodl closed 17 hours ago
The same issue is discovered with the contract on L2: https://github.com/ethstorage/es-node/issues/314
A possible cause is that another submission updated the difficulty/lastMinedTime in the contract after the current node retrieved mining info, but before its mining tx is executed.
Integration tests still fail with this error (diff not match).
https://github.com/ethstorage/es-node/actions/runs/11200265994/job/31133678610.
https://github.com/ethstorage/es-node/actions/runs/11158402497/job/31014607228
log: es-node-it.log
As commented above, this error could happen when the difficulty has been changed after a mining task starts and before it is submitted. The following logs are picked up from the attachment in which all the events happened within 1 minute, demonstrating that the difficulty of shard 0 has changed from 1,834,471 to 1,891,798 while the miner prepares its transaction: notice that "Generate zk proof done" takes 78.249 seconds.
t=2024-10-07T08:09:19+0000 lvl=info msg="Mining info retrieved" shard=0 lastMineTime=1,728,288,360 difficulty=1,834,471 proofsSubmitted=6
...
t=2024-10-07T08:09:44+0000 lvl=info msg="Mining info retrieved" shard=0 lastMineTime=1,728,288,396 difficulty=1,891,798 proofsSubmitted=7
...
t=2024-10-07T08:09:51+0000 lvl=info msg="Generate zk proof done" sampleIdx="[1632 2819]" timeUsed(s)=78.249
t=2024-10-07T08:09:51+0000 lvl=info msg="Got storage proof" shard=0 block=6,831,012 kvIdx="[5891 6129]" sampleIdxsInKv="[1632 2819]"
...
t=2024-10-07T08:09:51+0000 lvl=eror msg="Estimate gas failed" error="execution reverted: StorageContract: diff not match"
It is an edge case that happens only when the mining transactions are submitted too frequently on the same shard. For example, there are 7 attempts to submit mining tx in less than half a minute from 08:09:28 to 08:09:51 according to the log.
Resolved as https://github.com/ethstorage/storage-contracts-v1/pull/113 lower the frequency of mining txs.
System information
Build date: Jul 3 2024 System version: e.g. amd64/linux Golang version: e.g. go1.21 Commit hash : 053b1b0e6cd152f874b3eb07e474c94943c402ab
Expected behaviour
Mining success
Actual behaviour
Steps to reproduce the behaviour
Backtrace
When submitting logs: please submit them as text and not screenshots.