We need to test this against reorgs. It seems like the architecture of this may result in inconsistent state of checkpoints during reorgs.
- Have a chain with blocks
.. [100:A] [101:B] with relevant txs in both A and B.
- Sync up to 100 (calling
.next).
- Reorg so that blocks from 100 are replaced (inclusive).
.. [100:A'] [101:B'].
- Call
.next again.
- Check that checkpoints end in
.. [100:A'] [101:B'] and we have emitted relevant txs in A' and B'.
Originally posted by @evanlinjin in #1614 (comment)
We need to test this against reorgs. It seems like the architecture of this may result in inconsistent state of checkpoints during reorgs.
.. [100:A] [101:B]with relevant txs in both A and B..next)... [100:A'] [101:B']..nextagain... [100:A'] [101:B']and we have emitted relevant txs inA'andB'.Originally posted by @evanlinjin in #1614 (comment)