Skip to content

refactor: extract provider-types crate for shared provider identity types - #402

Open
danielbui12 wants to merge 3 commits into
devfrom
provider_types
Open

refactor: extract provider-types crate for shared provider identity types#402
danielbui12 wants to merge 3 commits into
devfrom
provider_types

Conversation

@danielbui12

Copy link
Copy Markdown
Member

Primary changes

  • Add crates/providers/types (provider-types)
  • Move KeyScheme and ProviderKeypair out of provider-node's crate root into provider-types, gating the clap::ValueEnum derive behind an optional clap feature
  • Move ProviderInfo out of provider-coordinator into provider-types
  • Rewire every call site in provider-node, provider-coordinator, their test suites, and the storage-client register_provider example onto provider-types directly, with no re-export shims left behind

Issues

- Add crates/providers/types (provider-types), Apache-2.0
- Move KeyScheme and ProviderKeypair out of provider-node's crate root
- Gate KeyScheme's clap::ValueEnum derive behind an optional clap feature
- Move ProviderInfo out of provider-coordinator into provider-types
- Rewire provider-coordinator and its chain_state_integration test onto provider-types
- Drop provider-coordinator's now-unused serde dependency
- Import KeyScheme and ProviderKeypair from provider-types directly in cli.rs and replica_sync_coordinator.rs, instead of through a crate-root re-export
- Import ProviderInfo from provider-types in negotiate.rs, types.rs, and lib.rs's signing-key guard
- Retarget provider-node's integration tests and the storage-client register_provider example onto provider-types
- Add provider-types to the coverage script's measured package list
@danielbui12 danielbui12 self-assigned this Sep 10, 2026
/// Replica sync price (None if not accepting replicas).
pub replica_sync_price: Option<u128>,
/// Whether accepting extensions.
pub accepting_extensions: bool,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@danielbui12 can we do those stats refactor here?

Comment thread crates/providers/types/src/lib.rs Outdated
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: Apache-2.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

not sure if registration.rs is the best, maybe just provider.rs or put directly to the lib.rs?

Comment thread provider-node/src/lib.rs
@@ -401,113 +329,14 @@ mod tests {
/// `sr25519::Signature`, asserting the variant tag.
fn sig_from_hex(sig_hex: &str) -> sr25519::Signature {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@danielbui12 don't we already have some helper for this somewhere?

Comment thread provider-node/src/lib.rs
}

/// Derive a keypair from a SURI like `//Alice`.
fn keypair_for(seed: &str) -> sr25519::Pair {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

most places we are using sr25519::Pair::from_string and keypair_for is just used 3x, I would probably remove keypair_for and align all the usage across

@bkontur bkontur left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm, left just some ultranits (that can be omitted or follow-uped

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