Skip to content
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

Mining error: execution reverted: StorageContract: diff not match #304

Closed
qzhodl opened this issue Jul 3, 2024 · 5 comments
Closed

Mining error: execution reverted: StorageContract: diff not match #304

qzhodl opened this issue Jul 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working high priority

Comments

@qzhodl
Copy link
Collaborator

qzhodl commented Jul 3, 2024

System information

Build date: Jul 3 2024
System version: e.g. amd64/linux
Golang version: e.g. go1.21
Commit hash : 053b1b0

Expected behaviour

Mining success

Actual behaviour

4981720001105_ pic

Steps to reproduce the behaviour

Backtrace

[backtrace]

When submitting logs: please submit them as text and not screenshots.

@syntrust
Copy link
Collaborator

The same issue is discovered with the contract on L2: #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.

@syntrust
Copy link
Collaborator

syntrust commented Sep 9, 2024

Fixed in #315

@syntrust syntrust closed this as completed Sep 9, 2024
@ping-ke ping-ke reopened this Oct 8, 2024
@ping-ke
Copy link
Collaborator

ping-ke commented Oct 8, 2024

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

1728352874009
log: es-node-it.log
image

@syntrust
Copy link
Collaborator

syntrust commented Oct 8, 2024

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.

@syntrust
Copy link
Collaborator

Resolved as ethstorage/storage-contracts-v1#113 lower the frequency of mining txs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority
Projects
None yet
Development

No branches or pull requests

3 participants