Skip to content

Conversation

@Davidson-Souza
Copy link
Member

@Davidson-Souza Davidson-Souza commented Jan 29, 2024

This PR aims to build a three stage process to start and maintain a node. This will be helpful in projects like #64 and #115, and the general workflow is:

  • ChainSeletor will find the best chain we know about. Currently, it will simply find the most work chain and follow that. But we can add the logic needed for Proof-of-Work fraud proof: Tracker issue #115 here. After this stage finishes, we are guaranteed to be in the most-work chain we've found among our peers (and after Proof-of-Work fraud proof: Tracker issue #115 is finished, we are almost certain that this chain is valid).
  • BackfillNode will download a range of blocks and verify them. This stage is used to backfill our chain and make sure that: i) this chain is valid ii) the state we started working is the right one.
  • RunningNode is the same we have now. It handles requests by users, new blocks and so on. After ChainSelector returns, we can start a RunningNode and multiple SyncPeers in parallel, so our user can start using their node as soon as ChainSelector returns (which should be fairly quick).

RunningNode should also download the BIP158 block filters, allowing users to find historical transactions before the backfill process finishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant