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

refactor: ♻️ Use ForestStorageCaching for BSPs #281

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

ffarall
Copy link
Contributor

@ffarall ffarall commented Dec 9, 2024

In this PR:

  1. Upgrade to Rust toolchain 1.83.0
    1. Fix crossBuildMac script to include libpq.so directory in linker paths.
  2. Use ForestStorageCaching for BSPs, now that they will handle Forest Storage snapshots.
    1. Handle this in BSP tasks.
    2. Handle this in RPCs.
  3. Refactor Blockchain Service to store only ONE provider_id, that can either be a BSP or MSP ID.
  4. Make StorageHub Builder implementations have an async build() so that they're able to run async functions when initialising.
    1. Initialise BSPs by making them always have at least one Forest Storage which has the current best version of the BSPs Forest.
  5. Fix bug in Blockchain Service where handle_initial_sync was never called.
  6. Rename Runnable trait for StorageHub Builder to Buildable.

TODOs for other PRs:

  • Define properly the number of blocks behind for which Substrate triggers going into synching mode.
  • Implement taking snapshots in Forest root changes in BSP/MSP tasks.
  • Implement switching between Forest snapshots in reorgs.
  • Send events to check that this node has a Forest Storage for the BSP that it manages. Do this in:
    • Initial sync.
    • When it changes to manage another BSP. Here we should create a snapshot of the previously managed BSP.
  • Send events to check that this node has a Forest Storage for the Buckets of the MSP it manages. Do this in:
    • Initial sync.
    • When it changes from managing another Provider.
  • Catch up to Forest root writes after coming out of synching mode.

@ffarall ffarall changed the title reorg: ♻️ Use ForestStorageCaching for BSPs refactor: ♻️ Use ForestStorageCaching for BSPs Dec 10, 2024
@ffarall ffarall marked this pull request as ready for review December 11, 2024 00:27
Copy link
Collaborator

@timbrinded timbrinded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍

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.

3 participants