Skip to content

Conversation

@saraswatpuneet
Copy link
Contributor

@saraswatpuneet saraswatpuneet commented Sep 2, 2025

Goal

The goal of this PR is to introduce following 4 extrinsic to allow updating provider registry and application contexts

  • propose_to_update_provider
  • update_provider_via_governance
  • propose_to_update_application
  • update_application_via_governance

Additionally, a create_application extrinsic is introduced to make it easy to create applications for testing and is added in BaseFilter

Closes #2577
Closes #2578

Checklist

  • Updated Pallet Readme?
  • Updated js/api-augment for Custom RPC APIs?
  • Design doc(s) updated?
  • Unit Tests added?
  • e2e Tests added?
  • Benchmarks added?
  • Spec version incremented?

@codecov
Copy link

codecov bot commented Sep 2, 2025

Codecov Report

❌ Patch coverage is 93.43066% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pallets/msa/src/lib.rs 93.43% 9 Missing ⚠️
Files with missing lines Coverage Δ
pallets/msa/src/migration/v2.rs 0.00% <ø> (ø)
pallets/msa/src/lib.rs 91.74% <93.43%> (+0.57%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 2, 2025
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 2, 2025
@saraswatpuneet saraswatpuneet changed the title [WIP] Update provider registry and application via governance [WIP] Update provider registry and application registry via governance Sep 2, 2025
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 2, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 3, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 3, 2025
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 3, 2025
@saraswatpuneet saraswatpuneet changed the title [WIP] Update provider registry and application registry via governance Update provider registry and application registry via governance Sep 3, 2025
@saraswatpuneet saraswatpuneet marked this pull request as ready for review September 3, 2025 15:07
@saraswatpuneet saraswatpuneet requested review from a team, JoeCap08055, aramikm, claireclark1, enddynayn, mattheworris and shannonwells and removed request for a team September 3, 2025 15:07
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 3, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 4, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 4, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 4, 2025
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 5, 2025
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 5, 2025
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 5, 2025
Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

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

Overall looks good, added some nits and concerns

Comment on lines +314 to +317
// Block `create_provider`, `create_provider_v2`, `create_application` and `create_schema` calls from utility batch
RuntimeCall::Msa(pallet_msa::Call::create_provider { .. }) |
RuntimeCall::Msa(pallet_msa::Call::create_provider_v2 { .. }) |
RuntimeCall::Msa(pallet_msa::Call::create_application { .. }) |
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the problem with having features on top of extrinsics was that it would modify the extrinsic indices between testnet and mainnet when we didn't have explicit index assignment for each extrinsic.

The other issue is the metadata compatibility. Having metadata for a feature that is disabled is better compared to not having any metadata for it. If we gate extrinisics by feature it would fork metadata into 2 different versions depending on if it was generated for testnet or mainnnet which can also be another pain point in future.

I think if we decide to add feature to these it should probably be inside the extrinsic body and the implementation should be refactored to support this.

/// * [`Error::InvalidBCP47LanguageCode`] - If the provided BCP 47 language code is invalid.
/// * [`Error::ApplicationNotFound`] - If the application is not registered.
#[pallet::call_index(28)]
#[pallet::weight(T::WeightInfo::propose_to_update_application())]
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: does this also need the same benchmark changes?

Copy link
Contributor Author

@saraswatpuneet saraswatpuneet Sep 5, 2025

Choose a reason for hiding this comment

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

Proposal does not really change the state but create a proposal and that's it so it's not useful to add or not hence all proposal_* related ones have no parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So we use the max payload that can sent to it to compute the best worst estimate

@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Sep 5, 2025
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 6, 2025
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 6, 2025
@saraswatpuneet saraswatpuneet merged commit 0182963 into feat/provider-context-development Sep 6, 2025
31 of 32 checks passed
@saraswatpuneet saraswatpuneet deleted the 2549_update_provider branch September 6, 2025 00:35
saraswatpuneet added a commit that referenced this pull request Sep 18, 2025
# Details

[Design
Doc](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_contexts.md)

Provider Context allows provider to now register a minimal profile
`ProviderRegistryEntry` and `ApplicationContext` for provider's default
profile and various applications providers want to register.

Providers which want to register multiple applications under single
provider delegation but distributed across multiple app. Following
issues were resolved as part of this work with following salient points:

1. Migration existing `ProviderToRegistryEntry` to host new
`ProviderRegistryEntry` payload
2. Introduce new state `ProviderToApplicationRegistry` and
`ApprovedLogos` storage maps.
3. CID's are computed in deterministic way =
`base(cid_v1(sha_256(logo_bytes)))` where logo_bytes are .png image
bytes.
4. ApprovedLogos ensure it matches CID and logoBytes but recomputing and
checking on chain.

Issues complete as part of  `Provider Context` work

- [x] #2523 
- [x] #2524 
- [x] #2525 
- [x] #2528 
- [x] #2526
- [x] #2577 
- [x] #2578 

Closes #2578 
Closes #2577 


# Discussion items
- [x] Do we feature flag than base filter out extrinsics @JoeCap08055
comment
[here](#2587 (comment))

# Checklist
- [x] Updated Pallet Readme?
- [x] Updated js/api-augment for Custom RPC APIs?
- [x] Design doc(s) updated?
- [x] Unit Tests added?
- [x] e2e Tests added?
- [x] Benchmarks added?
- [x] Spec version incremented?

---------

Co-authored-by: Joe Caputo <joseph.caputo@projectliberty.io>
Co-authored-by: Aramik <aramikm@gmail.com>
Co-authored-by: Matthew Orris <1466844+mattheworris@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metadata-changed Metadata has changed since the latest full release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants