Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distribution feature for the storage pallet. #2552

Merged
merged 25 commits into from
Aug 2, 2021

Conversation

shamil-gadelshin
Copy link
Contributor

@shamil-gadelshin shamil-gadelshin commented Jul 29, 2021

Supersedes this draft PR.
Initial specification.

Changes

New extrinsics

  • Distribution working group leader extrinsics
    • create_distribution_bucket_family
    • delete_distribution_bucket_family
    • create_distribution_bucket
    • delete_distribution_bucket
    • update_distribution_bucket_status
    • update_distribution_buckets_for_bag
    • distribution_buckets_per_bag_limit
    • update_distribution_bucket_mode
    • update_families_in_dynamic_bag_creation_policy
    • invite_distribution_bucket_operator
    • cancel_distribution_bucket_operator_invite
    • remove_distribution_bucket_operator
  • Distribution provider extrinsics
    • accept_distribution_bucket_invitation
    • set_distribution_operator_metadata

Constants

  • Removed
    • DefaultMemberDynamicBagCreationPolicy
    • DefaultChannelDynamicBagCreationPolicy
  • Added
    • DefaultMemberDynamicBagNumberOfStorageBuckets
    • DefaultChannelDynamicBagNumberOfStorageBuckets
    • MaxDistributionBucketFamilyNumber
    • MaxDistributionBucketNumberPerFamily
    • DistributionBucketsPerBagValueConstraint
    • MaxNumberOfPendingInvitationsPerDistributionBucket

New types

  • DistributionBucket
  • DistributionBucketFamily

New storage entries

  • NextDistributionBucketFamilyId
  • DistributionBucketFamilyById
  • DistributionBucketFamilyNumber
  • NextDistributionBucketId
  • DistributionBucketsPerBagLimit

# Conflicts:
#	runtime-modules/storage/src/lib.rs
#	runtime-modules/storage/src/tests/mod.rs
# Conflicts:
#	runtime-modules/storage/src/lib.rs
#	runtime/src/lib.rs
- delete_distribution_bucket_family

# Conflicts:
#	runtime-modules/storage/src/lib.rs
- add ‘create_distribution_bucket’ extrinsic
- add MaxDistributionBucketNumberPerFamily constant

# Conflicts:
#	runtime-modules/storage/src/tests/fixtures.rs
- add `update_distribution_bucket_status` extrinsic

# Conflicts:
#	runtime-modules/storage/src/lib.rs
- add `delete_distribution_bucket` extrinsic
- add `update_distribution_buckets_for_bag`
- add `DistributionBucketsPerBagValueConstraint` constant

# Conflicts:
#	runtime-modules/storage/src/bag_manager.rs
#	runtime-modules/storage/src/tests/mod.rs
Fix `update_storage_buckets_for_bag` extrinsic. Change bucket limit comparison.

# Conflicts:
#	runtime-modules/storage/src/lib.rs
#	runtime-modules/storage/src/tests/mod.rs
- add `distribution_buckets_per_bag_limit`

# Conflicts:
#	runtime-modules/storage/src/tests/mod.rs
- add `update_distribution_bucket_mode` extrinsic

# Conflicts:
#	runtime-modules/storage/src/lib.rs
- add `update_families_in_dynamic_bag_creation_policy ` extrinsic
# Conflicts:
#	runtime-modules/storage/src/lib.rs
#	runtime-modules/storage/src/tests/mod.rs
- add `invite_distribution_bucket_operator`

# Conflicts:
#	runtime-modules/storage/src/lib.rs
- add `cancel_distribution_bucket_operator_invite`
- add `accept_distribution_bucket_invitation`
- add `set_distribution_operator_metadata`
- add `MaxNumberOfPendingInvitationsPerDistributionBucket`
- add `remove_distribution_bucket_operator`
- add ‘assigned_bags’ number
- change ‘delete_distribution_bucket’ and ‘delete_distribution_bucket’ extrinsics (add bag assignment checks)
- rename and remove mutable variables.
Copy link
Member

@bedeho bedeho left a comment

Choose a reason for hiding this comment

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

Awesome job, just one minor point.

/// Distribution bucket family.
#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
#[derive(Encode, Decode, Default, Clone, PartialEq, Eq, Debug)]
pub struct DistributionBucketFamilyObject<DistributionBucketId: Ord, WorkerId: Ord> {
Copy link
Member

Choose a reason for hiding this comment

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

Why are you introducing the Object post-fix for the bucket family and bucket? The reason DataObject has the this is because it explicitly is supposed to be represent the idea of an object or blob, this does not apply to these other types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here: dca15ca

@shamil-gadelshin shamil-gadelshin requested a review from bedeho August 2, 2021 14:15
Copy link
Member

@bedeho bedeho left a comment

Choose a reason for hiding this comment

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

LGTM.

@bedeho bedeho merged commit f71f4d8 into Joystream:storage_v2 Aug 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants