Skip to content

Conversation

@saraswatpuneet
Copy link
Collaborator

@saraswatpuneet saraswatpuneet commented Aug 12, 2025

Details

Design Doc

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

Closes #2578
Closes #2577

Discussion items

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?

…hanges around it (#2537)

# Goal
This PR introduces changes required to support the new Provider Context
model as outlined in the [Provider Contexts Design
Doc](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_contexts.md).
It updates the structure and handling of providers to allow them to
represent a company with one or more applications, supporting
internationalized metadata and trusted branding via content-addressed
hashes.

Closes  #2523 

## Summary of Changes
### Registry and Extrinsics
-  Updated ProviderRegistryEntry:
-  Replaces the old struct name with a new struct supporting:
            default_name: BoundedString
            default_logo: Option<Cid>
            localized_name: BoundedBTreeMap<LanguageCode, BoundedString>
            localized_logo: BoundedBTreeMap<LanguageCode, Cid>

- Updated propose_to_be_provider extrinsic:
- Updated create_provider_by_governance extrinsic
- Updated create_provider extrinsic
- Updated Benchmarks
- Updated Unit tests/e2e tests
- Added e2e tests
- Added unit tests
- Added `ProviderToRegistryEntry` to migration to storage version `2`
- Tested try-runtime migration with `Paseo` and `Mainnet` and it works


## In progress
- [x] add more unit tests
- [ ] run a full cycle of try-runtime to check migrations 

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


## Snaps
- Successful execution of `on_runtime_upgrade` via try-runtime cli on
paseo
<img width="1574" height="370" alt="image"
src="https://github.com/user-attachments/assets/498f3baa-0f67-4088-8fa5-d42dc90bb961"
/>

---------

Co-authored-by: Joe Caputo <joseph.caputo@projectliberty.io>
@codecov
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 91.80328% with 40 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pallets/msa/src/lib.rs 93.50% 26 Missing ⚠️
common/primitives/src/utils.rs 0.00% 9 Missing ⚠️
pallets/msa/src/migration/v2.rs 91.66% 5 Missing ⚠️
Files with missing lines Coverage Δ
common/primitives/src/cid.rs 100.00% <100.00%> (ø)
common/primitives/src/msa.rs 98.78% <100.00%> (+0.13%) ⬆️
pallets/msa/src/types.rs 100.00% <100.00%> (ø)
pallets/msa/src/migration/v2.rs 91.66% <91.66%> (ø)
common/primitives/src/utils.rs 92.89% <0.00%> (-4.45%) ⬇️
pallets/msa/src/lib.rs 92.56% <93.50%> (+0.08%) ⬆️
🚀 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.

@saraswatpuneet saraswatpuneet changed the title [WIP][Provider Context] Update provider creation to intake new payload + c… [WIP] Provider Context Aug 12, 2025
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Aug 12, 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 Aug 12, 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 Aug 13, 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 Aug 14, 2025
… a given provider (#2551)

# Goal
## Details

With respect to provider context design doc, complete the following:
Refer [design
doc](https://github.com/frequency-chain/frequency/blob/main/designdocs/provider_contexts.md#changes-and-additions-in-extrinsics-)


- [x] Add a new extrinsic `propose_to_add_application` that receives a
`ProviderRegistryEntry` type payload from provider MSA
- [x] Ensure the origin is registered provider
- [x] Add a new state `ProviderToApplicationRegistry` douple map
(ProviderId, ApplicationIndex) to store a new application once a
goverance proposal is approved for application, where ApplicationIndex
is monotically increasing number for each provider level application
from 0..N
- [x] Move all the approves hashes from payload to `ApprovedLogoHashes`
state
- [x] Benchmark new extrinsic
- [x] Add unit tests and e2e tests 

## Acceptance Criteria
1. Ability to propose and add new applications 
2. `ApprovedHashes` successfully contains approved logo hashes from 1
3. Tests emulating range of tests for adding and approving applications
for providers
4. Benchmarking and e2e tests

Closes #2524 

# Discussion

- <!-- List discussion items -->

# Checklist
- [ ] Updated Pallet Readme?
- [ ] 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>
@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 Aug 14, 2025
# Goal
The goal of this PR is <!-- insert goal here -->

Closes #2525 


- <!-- List discussion items -->

# Checklist
- [ ] Updated Pallet Readme?
- [ ] Updated js/api-augment for Custom RPC APIs?
- [ ] Design doc(s) updated?
- [x] Unit Tests added?
- [x] e2e Tests added?
- [x] Benchmarks added?
- [x] Spec version incremented?
@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 Aug 25, 2025
…ntext (#2573)

# Goal
The goal of this PR is to introduce a general purpose RPC to fetch
provider context. In this rpc if user dont specify application id or
locale, a default profile is returned which is registered at time of
provider creation otherwise return details for application id provided

Closes  #2526 

# Discussion

- <!-- List discussion items -->

# Checklist
- [ ] Updated Pallet Readme?
- [x] Updated js/api-augment for Custom RPC APIs?
- [ ] Design doc(s) updated?
- [x] Unit Tests added?
- [x] e2e Tests added?
- [ ] Benchmarks added?
- [ ] Spec version incremented?
@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 Aug 27, 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
@saraswatpuneet saraswatpuneet changed the title [WIP] Provider Context Provider Context Sep 5, 2025
@saraswatpuneet saraswatpuneet changed the title Provider Context Provider Context: Minimal Profile for Provider and Applications Sep 5, 2025
# Goal
The goal of this PR is to introduce following 4 extrinsic to allow
updating provider registry and application contexts
- [x] `propose_to_update_provider`
- [x] `update_provider_via_governance`
- [x] `propose_to_update_application`
- [x] `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?
- [x] Unit Tests added?
- [x] e2e Tests added?
- [x] Benchmarks added?
- [ ] Spec version incremented?
@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 17, 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 17, 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 17, 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 17, 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 17, 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.

Looks great and a lot of great work!

Co-authored-by: Aramik <aramikm@gmail.com>
@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 17, 2025
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Sep 17, 2025
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Sep 17, 2025
Copy link
Collaborator

@enddynayn enddynayn left a comment

Choose a reason for hiding this comment

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

👍 amazing work!

@saraswatpuneet saraswatpuneet merged commit eb46456 into main Sep 18, 2025
64 of 65 checks passed
@saraswatpuneet saraswatpuneet deleted the feat/provider-context-development branch September 18, 2025 20:49
saraswatpuneet added a commit that referenced this pull request Sep 22, 2025
# Goal
The goal of this PR is to retain and remove `deprecated` marking from
`create_provider` since it is actively used in paseo/local testing. Also
notify repository of changes expected to be implemented.

Closes #2610 
# Discussion

*
[Discussion](#2549 (comment))
with ND/Joe.

# 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?
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

6 participants