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

bug(sync): Pending block may be fetched and applied before importing the previous block it is on #239

Open
1 task done
cchudant opened this issue Aug 28, 2024 · 2 comments

Comments

@cchudant
Copy link
Member

Is there an existing issue?

  • I have searched the existing issues

Description of bug

In dc-sync, we use a oneshot channel as a signal to start the pending block fetch/apply task once the tip of the blockchain has been reached.
The problem with that is that the pending block may end up being applied to the db before the channels have their blocks all applied: this may result in the node being in an inconsistent state where the parent_block_hash of the pending block does not match the block at tag latest.

This was found in #232 as we are now checking parent block hashes there.

Steps to reproduce

No response

@cchudant
Copy link
Member Author

I expect this to be fixed with the block import pipeline refactor coming before p2p, unless we really need to fix it before that.

@antiyro antiyro changed the title Pending block may be fetched and applied before importing the previous block it is on bug(sync): Pending block may be fetched and applied before importing the previous block it is on Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

2 participants
@cchudant and others