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

Simplify Crab token system #1310

Merged
merged 7 commits into from
Nov 8, 2023
Merged

Simplify Crab token system #1310

merged 7 commits into from
Nov 8, 2023

Conversation

aurexav
Copy link
Member

@aurexav aurexav commented Nov 1, 2023

Refer to #1273.

  • Stop inflation on Crab and Pangolin
  • Add OnSessionEnd to Config
  • Remove RingCurrency, UnixTime, RewardReminder and PayoutFraction from Config
  • Infation parameters need to be configured in runtime now

@aurexav aurexav added N-Crab S-Need Audit PR contains changes to fund-managing logic that should be properly reviewed and externally audited C-Pallet [Component] Something about pallet labels Nov 1, 2023

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

@boundless-forest boundless-forest self-requested a review November 2, 2023 02:26
Copy link
Member

@boundless-forest boundless-forest left a comment

Choose a reason for hiding this comment

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

I have some concerns about the payout of the Treasury reward. I haven't seen any test cases to ensure that there is no calculation overflow or potential panic if the Treasury is unable to pay for the 20_000 * UNIT. Others LGTM

pallet/staking/src/lib.rs Show resolved Hide resolved

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

This comment has been minimized.

Copy link

github-actions bot commented Nov 6, 2023

Check 74a6dfe crab-dev

Check runtime version

RuntimeVersion {
    spec_name: "Crab2",
    impl_name: "DarwiniaOfficialRust",
    authoring_version: 0,
-   spec_version: 6404,
+   spec_version: 6402,
    impl_version: 0,
    transaction_version: 0,
    state_version: 0,
}

Check runtime storage

Pallet DarwiniaStaking
+ Entry: StorageEntryMetadata { name: "Exposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Current stakers' exposure."] }
- Entry: StorageEntryMetadata { name: "Exposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Current stakers' exposure."] }
+ Entry: StorageEntryMetadata { name: "NextExposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Next stakers' exposure."] }
- Entry: StorageEntryMetadata { name: "NextExposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Next stakers' exposure."] }

Copy link

github-actions bot commented Nov 6, 2023

Check 74a6dfe darwinia-dev

Check runtime version

RuntimeVersion {
    spec_name: "Darwinia2",
    impl_name: "DarwiniaOfficialRust",
    authoring_version: 0,
-   spec_version: 6404,
+   spec_version: 6402,
    impl_version: 0,
    transaction_version: 0,
    state_version: 0,
}

Check runtime storage

Pallet DarwiniaStaking
+ Entry: StorageEntryMetadata { name: "Exposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Current stakers' exposure."] }
- Entry: StorageEntryMetadata { name: "Exposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Current stakers' exposure."] }
+ Entry: StorageEntryMetadata { name: "NextExposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Next stakers' exposure."] }
- Entry: StorageEntryMetadata { name: "NextExposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 319, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Next stakers' exposure."] }

Copy link

github-actions bot commented Nov 6, 2023

Check 74a6dfe pangoro-dev

Check runtime version

RuntimeVersion {
    spec_name: "Pangoro2",
    impl_name: "DarwiniaOfficialRust",
    authoring_version: 0,
-   spec_version: 6405,
+   spec_version: 6406,
    impl_version: 0,
    transaction_version: 0,
    state_version: 0,
}

Check runtime storage

Pallet DarwiniaStaking
+ Entry: StorageEntryMetadata { name: "Exposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 314, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Current stakers' exposure."] }
- Entry: StorageEntryMetadata { name: "Exposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 314, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Current stakers' exposure."] }
+ Entry: StorageEntryMetadata { name: "NextExposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 314, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Next stakers' exposure."] }
- Entry: StorageEntryMetadata { name: "NextExposures", modifier: Optional, ty: Map { hashers: [Twox64Concat], key: UntrackedSymbol { id: 0, marker: PhantomData<fn() -> core::any::TypeId> }, value: UntrackedSymbol { id: 314, marker: PhantomData<fn() -> core::any::TypeId> } }, default: [0], docs: [" Next stakers' exposure."] }

Copy link

github-actions bot commented Nov 6, 2023

Check 74a6dfe pangolin-dev

Check runtime version

Check runtime storage

Copy link
Contributor

@hackfisher hackfisher left a comment

Choose a reason for hiding this comment

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

LGTM

@aurexav aurexav merged commit 989beb8 into main Nov 8, 2023
13 checks passed
@aurexav aurexav deleted the xavier/simplify-crab-token-system branch November 8, 2023 07:01
@aurexav aurexav added S-Audited [Security] Audited and removed S-Need Audit PR contains changes to fund-managing logic that should be properly reviewed and externally audited labels Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Pallet [Component] Something about pallet S-Audited [Security] Audited
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants