Skip to content

Conversation

@saraswatpuneet
Copy link
Collaborator

@saraswatpuneet saraswatpuneet commented Aug 1, 2025

Goal

This PR introduces changes required to support the new Provider Context model as outlined in the Provider Contexts Design Doc. 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
    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

  • 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?
  • Unit Tests added?
  • e2e Tests added?
  • Benchmarks added?
  • Spec version incremented?

Snaps

  • Successful execution of on_runtime_upgrade via try-runtime cli on paseo
image

@saraswatpuneet saraswatpuneet changed the base branch from feat/provider-context to main August 5, 2025 16:33
@saraswatpuneet saraswatpuneet changed the base branch from main to feat/provider-context August 5, 2025 16:33
@saraswatpuneet saraswatpuneet changed the title [WIP] Update existing provider registry entry to new type + changes in pallet, runtime and benchmarks [Provider Context] Update provider creation to intake new payload + changes around it Aug 6, 2025
@saraswatpuneet saraswatpuneet marked this pull request as ready for review August 6, 2025 19:07
@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 11, 2025
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Aug 11, 2025
@saraswatpuneet saraswatpuneet changed the base branch from feat/provider-context to feat/provider-context-development August 11, 2025 18:28
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Aug 11, 2025
/// - [`Error::ExceedsMaxProviderNameSize`] - Too long of a provider name
#[pallet::call_index(11)]
#[pallet::weight(T::WeightInfo::propose_to_be_provider())]
#[pallet::weight(T::WeightInfo::propose_to_be_provider_v2())]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#[pallet::weight(T::WeightInfo::propose_to_be_provider_v2())]
#[pallet::weight(T::WeightInfo::propose_to_be_provider())]

I think this is the original, not the v2, correct?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or are we just using the same weights for both?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I assume we can since its calling underlying extrinsic (re-routing after size check), you suggest we have separate benchmarks for both?

/// * [`Error::DuplicateProviderRegistryEntry`] - a ProviderRegistryEntry associated with the given MSA id already exists.
#[pallet::call_index(12)]
#[pallet::weight(T::WeightInfo::create_provider_via_governance())]
#[pallet::weight(T::WeightInfo::create_provider_via_governance_v2())]
Copy link
Collaborator

Choose a reason for hiding this comment

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

same question as above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same thoughts, we have bench marked v2 in this case and v1 extrinsic just re-route call to v2 with default payload, not sure if we should benchmark both

@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 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 12, 2025
Copy link
Collaborator

@JoeCap08055 JoeCap08055 left a comment

Choose a reason for hiding this comment

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

some nits leftover, but nothing blocking
nice work!

@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
@saraswatpuneet saraswatpuneet merged commit f673341 into feat/provider-context-development Aug 12, 2025
31 of 32 checks passed
@saraswatpuneet saraswatpuneet deleted the 2523_update_provider_creation branch August 12, 2025 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change/storage-migration PR has a Storage Migration metadata-changed Metadata has changed since the latest full release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants