Skip to content

refactor(pallet): split impls into feature-grouped impls/ module#256

Merged
danielbui12 merged 10 commits into
devfrom
new_runtime_api
Jul 2, 2026
Merged

refactor(pallet): split impls into feature-grouped impls/ module#256
danielbui12 merged 10 commits into
devfrom
new_runtime_api

Conversation

@danielbui12

Copy link
Copy Markdown
Member

Changes

Follow up #239 (comment)

@danielbui12 ok, let's push this PR, I suggest couple of things:

create impls.rs and move all this functions impl<T: Config> Pallet { there
create separate PR just for this changes touching pallet + runtimes (looks like just introducing new runtime apis)

Issue

@danielbui12 danielbui12 requested a review from bkontur July 1, 2026 11:26
Comment thread docs/design/scalable-web3-storage-implementation.md Outdated
Comment thread docs/design/scalable-web3-storage-implementation.md Outdated
Comment thread pallet/src/impls/queries.rs Outdated
Comment thread pallet/src/impls/signatures.rs Outdated
Comment thread pallet/src/impls/signatures.rs Outdated
Comment thread pallet/src/impls/signatures.rs Outdated
Comment thread pallet/src/impls/mod.rs
@@ -0,0 +1,9 @@
pub mod agreements;

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 please, align all file headers with all other files (Licence stuff and so on)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@bkontur I created another PR to handle this :D #257

Comment thread pallet/src/impls/providers.rs Outdated
Comment thread pallet/src/impls/queries.rs Outdated
@danielbui12 danielbui12 self-assigned this Jul 2, 2026
Comment thread pallet/src/impls/agreements.rs Outdated
use storage_primitives::{BucketId, EndAction, ProviderRole, RemovalReason, ReplayError};

impl<T: Config> Pallet<T> {
pub fn validate_duration(

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.

validate_duration + calculate_payment does not seem related to the agreements, but ok for now probably

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As I checked, both of them are used along with StorageAgreements

/// then runs the same provider/capacity/stake checks as
/// `create_bucket_with_storage` before creating the bucket + primary
/// agreement.
pub fn establish_storage_agreement_internal(

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.

hmm, I would put all *internal as `pub(crate)

Suggested change
pub fn establish_storage_agreement_internal(
pub(crate) fn establish_storage_agreement_internal(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'll double check all functions.
establish_storage_agreement_internal / establish_replica_agreement_internal is used in L1 pallet

Comment thread pallet/src/runtime_api.rs Outdated

@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.

@danielbui12 please, align runtime apis with implementation.md and can go in https://github.com/paritytech/web3-storage/pull/256/changes#r3511253043

@danielbui12 danielbui12 requested a review from bkontur July 2, 2026 08:07
@danielbui12 danielbui12 enabled auto-merge July 2, 2026 08:29
@danielbui12 danielbui12 added this pull request to the merge queue Jul 2, 2026
Merged via the queue into dev with commit 4620532 Jul 2, 2026
40 checks passed
@danielbui12 danielbui12 deleted the new_runtime_api branch July 2, 2026 09:21
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.

Expose interfaces via a separate RuntimeApi

2 participants