From 626be780bb06bc5af6edde400a79f71a036fa511 Mon Sep 17 00:00:00 2001 From: Ayush Mishra Date: Tue, 27 Aug 2024 15:46:07 +0530 Subject: [PATCH] Changes to fix unprocessed eras (#423) ## Description ## Types of Changes Please select the branch type you are merging and fill in the relevant template. - [ ] Hotfix - [ ] Release - [ ] Fix or Feature ## Fix or Feature ### Types of Changes - [ ] Tech Debt (Code improvements) - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Dependency upgrade (A change in substrate or any 3rd party crate version) ### Migrations and Hooks - [ ] This change requires a runtime migration. - [ ] Modifies `on_initialize` - [ ] Modifies `on_finalize` ### Checklist for Fix or Feature - [ ] Change has been tested locally. - [ ] Change adds / updates tests if applicable. - [ ] Changelog doc updated. - [ ] `spec_version` has been incremented. - [ ] `network-relayer`'s [events](https://github.com/Cerebellum-Network/network-relayer/blob/dev-cere/shared/substrate/events.go) have been updated according to the blockchain events if applicable. - [ ] All CI checks have been passed successfully ## Checklist for Hotfix - [ ] Change has been deployed to Testnet. - [ ] Change has been tested in Testnet. - [ ] Changelog has been updated. - [ ] Crate version has been updated. - [ ] `spec_version` has been incremented. - [ ] Transaction version has been updated if required. - [ ] Pull Request to `dev` has been created. - [ ] Pull Request to `staging` has been created. - [ ] `network-relayer`'s [events](https://github.com/Cerebellum-Network/network-relayer/blob/dev-cere/shared/substrate/events.go) have been updated according to the blockchain events if applicable. - [ ] All CI checks have been passed successfully ## Checklist for Release - [ ] Change has been deployed to Devnet. - [ ] Change has been tested in Devnet. - [ ] Change has been deployed to Qanet. - [ ] Change has been tested in Qanet. - [ ] Change has been deployed to Testnet. - [ ] Change has been tested in Testnet. - [ ] Changelog has been updated. - [ ] Crate version has been updated. - [ ] Spec version has been updated. - [ ] Transaction version has been updated if required. - [ ] All CI checks have been passed successfully --- pallets/ddc-verification/src/lib.rs | 10 ++++++++-- runtime/cere-dev/src/lib.rs | 2 +- runtime/cere/src/lib.rs | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pallets/ddc-verification/src/lib.rs b/pallets/ddc-verification/src/lib.rs index 97ea14921..44aab0b63 100644 --- a/pallets/ddc-verification/src/lib.rs +++ b/pallets/ddc-verification/src/lib.rs @@ -2722,8 +2722,13 @@ pub mod pallet { .entry((payers_merkle_root_hash, payees_merkle_root_hash)) .or_insert_with(Vec::new); - ensure!(!signed_validators.contains(&caller.clone()), Error::::AlreadySignedEra); - signed_validators.push(caller.clone()); + // todo! Uncomment below code once we process unprocessed era on Devnet + // ensure!(!signed_validators.contains(&caller.clone()), Error::::AlreadySignedEra); + // signed_validators.push(caller.clone()); + // todo! Remove below code once we process unprocessed era on Devnet + if !signed_validators.contains(&caller.clone()) { + signed_validators.push(caller.clone()); + } let percent = Percent::from_percent(T::MAJORITY); let threshold = percent * >::get().len(); @@ -3275,6 +3280,7 @@ pub mod pallet { let validators = validators .map(|(_, k)| T::AccountId::decode(&mut &k.into().encode()[..]).unwrap()) .collect::>(); + log::info!("🙌Total validator from new session. {:?}", validators.len()); ValidatorSet::::put(validators); } diff --git a/runtime/cere-dev/src/lib.rs b/runtime/cere-dev/src/lib.rs index f6147081e..2082e8acb 100644 --- a/runtime/cere-dev/src/lib.rs +++ b/runtime/cere-dev/src/lib.rs @@ -149,7 +149,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 54118, + spec_version: 54119, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 19, diff --git a/runtime/cere/src/lib.rs b/runtime/cere/src/lib.rs index 24a447851..73e764bed 100644 --- a/runtime/cere/src/lib.rs +++ b/runtime/cere/src/lib.rs @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // and set impl_version to 0. If only runtime // implementation changes and behavior does not, then leave spec_version as // is and increment impl_version. - spec_version: 54118, + spec_version: 54119, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 19,