-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
…elete_file` tasks
…own the bucket ID
@@ -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. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes that makes sense.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
This PR depends on #312.
In this PR:
MutationsApplied
event inapply_forest_root_changes
of the Blockchain Service, to apply forest root changes of MSPs.insert_files_metadata
call frommsp_upload_file
, now that this is done in the Blockchain Service.query_buckets_for_msp
new runtime API to Providers pallet.event_info
togeneric_apply_delta
function fromProofsDealerInterface
. The intention is that users of this interface can pass aVec<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.