chainbound / bolt

Bolt: permissionless out-of-protocol proposer commitments.
https://chainbound.github.io/bolt-docs/
MIT License
27 stars 5 forks source link

Handle two or more pre-confirmations at the same slot in the demo #107

Open thedevbirb opened 4 days ago

thedevbirb commented 4 days ago

There is an edge case in the frontend demo where sending two pre-confirmations rapidly in the same slot can cause the second one to fail with NonceTooLow error. This is due to fact the nonce is obtained from the provider i.e. the execution state, which hasn't processed the pre-confirmed transaction yet, and as such the nonce of same transaction is the same of the first one.

In order to solve this, in the frontend we should increment the nonce of the account upon receiving the commitment from the sidecar

mempirate commented 4 days ago

Maybe this can help: https://x.com/_jxom/status/1802851459072925900

thedevbirb commented 4 days ago

On the sidecar there was an incorrect nonce inserted in the state diff, which has been fixed with the following commit: d074de9 (#62).