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

feat: ✨ Apply Forest root changes to Buckets in Blockchain Service #335

Merged
merged 58 commits into from
Feb 20, 2025

Conversation

ffarall
Copy link
Contributor

@ffarall ffarall commented Jan 22, 2025

This PR depends on #312.

In this PR:

  1. Handle MutationsApplied event in apply_forest_root_changes of the Blockchain Service, to apply forest root changes of MSPs.
  2. Remove insert_files_metadata call from msp_upload_file, now that this is done in the Blockchain Service.
  3. Add query_buckets_for_msp new runtime API to Providers pallet.
  4. Add event_info to generic_apply_delta function from ProofsDealerInterface. The intention is that users of this interface can pass a Vec<u8> of encoded info for context on what the delta is applied on. For the purpose of this PR, that is used for the File System pallet to pass down the encoded Bucket ID.

ffarall added 30 commits January 3, 2025 16:32
@ffarall ffarall marked this pull request as ready for review January 24, 2025 02:52
@@ -484,10 +484,14 @@ pub mod pallet {
/// This is the generic version of [`MutationsAppliedForProvider`](Event::MutationsAppliedForProvider)
/// when [`generic_apply_delta`](ProofsDealerInterface::generic_apply_delta) is used
/// and the root is not necessarily linked to a specific Provider.
///
/// Additional information for context on where the mutations were applied can be provided
/// by using the `event_info` field.
Copy link
Contributor

Choose a reason for hiding this comment

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

I would point to the common encode and decode functions if you agree to add them

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I won't include that encoding/decoding function and runtime API here in the ProofsDealer pallet. This pallet is abstracted over what other pallets might want to send as event_info. It should be in the FileSystem pallet IMO.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes that makes sense.

@snowmead
Copy link
Contributor

snowmead commented Feb 19, 2025

I noticed there are no integration tests added to the reorg. Was this planned for a separate PR?

@ffarall
Copy link
Contributor Author

ffarall commented Feb 19, 2025

I noticed there are no integration tests added to the reorg. Was this planned for a separate PR?

Yes. I gave it less urgency as "handling the reorgs" is essentially already tested with the BSP tests. It is the same functionality. But the right thing to do would be also to have tests for the MSPs. We'll just do it in a different PR, to prioritise other issues and tasks.

Thanks for bringing this up though!

@ffarall ffarall requested a review from snowmead February 19, 2025 22:44
Copy link
Contributor

@snowmead snowmead left a comment

Choose a reason for hiding this comment

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

Nice job!

@ffarall ffarall merged commit 5b2c1b2 into main Feb 20, 2025
25 checks passed
@ffarall ffarall deleted the feat/forest-root-catch-ups-msp branch February 20, 2025 15:37
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.

2 participants