-
Notifications
You must be signed in to change notification settings - Fork 3.9k
State / Tx batch Ordering Inconsistencies #295
Description
Describe the bug
State root ordering within state commitment chain batches may differ from the transaction ordering with which the state roots are associated.
The root cause (no pun intended) appears to be that the SQL queries that assemble and order the batches order by different fields that should produce the same result but may not.
Steps to reproduce
Steps to reproduce the behavior:
This is hard to reproduce, as it appears to be non-deterministic and based upon how Postgres assigns the ID of its records, possibly across multiple atomic transactions.
The best way to reproduce is by:
- Submitting a few hundred transactions in a matter of seconds to the L2 Node without the transaction batch creator or state commitment batch creator running but with the L2 Chain Data Persister running
- Continue (1) until you run into a situation where there is at least one
l2_tx_outputrecord that does not appear in the same index when ordering the table's records byIDvs byblock_number - Run the state commitment batch creator & transaction batch creator
- See that the transaction in question appears at a different cumulative index when batched
Expected behavior
State commitment batches have state roots which exactly correspond in number and order to the transactions within the transaction batch(es) they are committing to.
Screenshots
N/A
Specifications
- Version: Commit 29f2fc6847eca7d5ff90fceae0293916fed1669c
- OS: N/A
- Node Version: N/A