Skip to content

Commit 2c5f28f

Browse files
Merge pull request #569 from Cerebellum-Network/release/7.3.6
Added mechanism to handle Remainder of Era Rewards
2 parents 78b75f4 + cc0c79b commit 2c5f28f

File tree

6 files changed

+52
-30
lines changed

6 files changed

+52
-30
lines changed

.github/workflows/publish-docker-image-to-dockerhub.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ jobs:
1212
tag-and-push:
1313
runs-on: [self-hosted, cere-network-xlarge]
1414
steps:
15-
- name: Configure AWS credentials
16-
uses: aws-actions/configure-aws-credentials@v1
15+
- name: Configure aws credentials
16+
uses: aws-actions/configure-aws-credentials@v2
1717
with:
18-
aws-access-key-id: ${{ secrets.DEV_NETWORK_AWS_ACCESS_KEY_ID }}
19-
aws-secret-access-key: ${{ secrets.DEV_NETWORK_AWS_SECRET_ACCESS_KEY }}
18+
role-to-assume: arn:aws:iam::${{ vars.SHARED_AWS_ACCOUNT_ID }}:role/github
19+
role-session-name: ${{ github.event.repository.name }}
2020
aws-region: us-west-2
21+
2122
- name: Login to Amazon ECR
2223
id: login-ecr
2324
uses: aws-actions/amazon-ecr-login@v1
@@ -30,6 +31,7 @@ jobs:
3031
docker image tag $ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_REF##*/}
3132
docker image tag $ECR_REGISTRY/$ECR_REPOSITORY:$GITHUB_SHA $DOCKERHUB_REPOSITORY/$PACKAGE_NAME:latest
3233
docker push $ECR_REGISTRY/$ECR_REPOSITORY:${GITHUB_REF##*/}
34+
3335
- name: Login to DockerHub
3436
uses: docker/login-action@v1
3537
with:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- [C] Changes is `Cere` Runtime
1111
- [D] Changes is `Cere Dev` Runtime
1212

13+
## [7.3.6]
14+
15+
- [C,D] Added mechanism to handle Remainder of Era Rewards
16+
1317
## [7.3.5]
1418

1519
- [C,D] Turn-Off Inflation and change reward source

Cargo.lock

Lines changed: 19 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[workspace.package]
2-
version = "7.3.2"
2+
version = "7.3.6"
33
authors = ["Cerebellum-Network"]
44
edition = "2021"
55
homepage = "https://cere.network/"

runtime/cere-dev/src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ use ismp::{
136136
host::StateMachine,
137137
router::{Request, Response},
138138
};
139-
use pallet_treasury::PositiveImbalanceOf;
139+
use pallet_treasury::{NegativeImbalanceOf, PositiveImbalanceOf};
140140
use sp_core::H256;
141141
mod hyperbridge_ismp;
142142
mod weights;
@@ -164,7 +164,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
164164
// and set impl_version to 0. If only runtime
165165
// implementation changes and behavior does not, then leave spec_version as
166166
// is and increment impl_version.
167-
spec_version: 73108,
167+
spec_version: 73109,
168168
impl_version: 0,
169169
apis: RUNTIME_API_VERSIONS,
170170
transaction_version: 24,
@@ -566,7 +566,14 @@ impl pallet_staking::BenchmarkingConfig for StakingBenchmarkingConfig {
566566
type MaxNominators = ConstU32<1000>;
567567
type MaxValidators = ConstU32<1000>;
568568
}
569+
pub struct BurnSource;
569570

571+
impl OnUnbalanced<NegativeImbalanceOf<Runtime>> for BurnSource {
572+
fn on_unbalanced(amount: NegativeImbalanceOf<Runtime>) {
573+
// Burn the tokens (decrease total issuance)
574+
drop(amount);
575+
}
576+
}
570577
pub struct RewardSource;
571578

572579
impl OnUnbalanced<PositiveImbalanceOf<Runtime>> for RewardSource {
@@ -593,7 +600,7 @@ impl pallet_staking::Config for Runtime {
593600
type CurrencyBalance = Balance;
594601
type UnixTime = Timestamp;
595602
type CurrencyToVote = CurrencyToVote;
596-
type RewardRemainder = Treasury;
603+
type RewardRemainder = BurnSource;
597604
type RuntimeEvent = RuntimeEvent;
598605
type Slash = Treasury; // send the slashed funds to the treasury.
599606
type Reward = RewardSource;

runtime/cere/src/lib.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ use ismp::{
130130
host::StateMachine,
131131
router::{Request, Response},
132132
};
133-
use pallet_treasury::PositiveImbalanceOf;
133+
use pallet_treasury::{NegativeImbalanceOf, PositiveImbalanceOf};
134134
use sp_core::H256;
135135
mod hyperbridge_ismp;
136136
mod weights;
@@ -159,7 +159,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
159159
// and set impl_version to 0. If only runtime
160160
// implementation changes and behavior does not, then leave spec_version as
161161
// is and increment impl_version.
162-
spec_version: 73108,
162+
spec_version: 73109,
163163
impl_version: 0,
164164
apis: RUNTIME_API_VERSIONS,
165165
transaction_version: 24,
@@ -563,6 +563,15 @@ impl pallet_staking::BenchmarkingConfig for StakingBenchmarkingConfig {
563563
type MaxValidators = ConstU32<1000>;
564564
}
565565

566+
pub struct BurnSource;
567+
568+
impl OnUnbalanced<NegativeImbalanceOf<Runtime>> for BurnSource {
569+
fn on_unbalanced(amount: NegativeImbalanceOf<Runtime>) {
570+
// Burn the tokens (decrease total issuance)
571+
drop(amount);
572+
}
573+
}
574+
566575
pub struct RewardSource;
567576

568577
impl OnUnbalanced<PositiveImbalanceOf<Runtime>> for RewardSource {
@@ -589,7 +598,7 @@ impl pallet_staking::Config for Runtime {
589598
type CurrencyBalance = Balance;
590599
type UnixTime = Timestamp;
591600
type CurrencyToVote = CurrencyToVote;
592-
type RewardRemainder = Treasury;
601+
type RewardRemainder = BurnSource;
593602
type RuntimeEvent = RuntimeEvent;
594603
type Slash = Treasury; // send the slashed funds to the treasury.
595604
type Reward = RewardSource;

0 commit comments

Comments
 (0)