Skip to content

Commit

Permalink
Revert "Make the threshold check same in both mainnet and parachain"
Browse files Browse the repository at this point in the history
This reverts commit 47113bb.
  • Loading branch information
Gauthamastro committed Feb 1, 2024
1 parent 47113bb commit 441ddd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions pallets/thea-message-handler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use parity_scale_codec::Encode;
use sp_runtime::{
traits::{BlockNumberProvider, Member},
transaction_validity::{InvalidTransaction, TransactionValidity, ValidTransaction},
RuntimeAppPublic, SaturatedConversion,
Percent, RuntimeAppPublic, SaturatedConversion,
};
use sp_std::prelude::*;
use thea_primitives::{
Expand Down Expand Up @@ -273,8 +273,11 @@ impl<T: Config> Pallet<T> {

let authorities = <Authorities<T>>::get(payload.validator_set_id).to_vec();
// Check for super majority
if !payload.threshold_reached(authorities.len()) {
log::error!(target:"thea","Threshold not reached, Signs len: {:?}", payload.signatures.len());
const MAJORITY: u8 = 67;
let p = Percent::from_percent(MAJORITY);
let threshold = p * authorities.len();
if payload.signatures.len() < threshold {
log::error!(target:"thea","Threshold: {:?}, Signs len: {:?}",threshold, payload.signatures.len());
return InvalidTransaction::Custom(2).into()
}

Expand Down
2 changes: 1 addition & 1 deletion runtimes/parachain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
spec_name: create_runtime_str!("polkadex-parachain"),
impl_name: create_runtime_str!("polkadex-parachain"),
authoring_version: 1,
spec_version: 11,
spec_version: 10,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 1,
Expand Down

0 comments on commit 441ddd4

Please sign in to comment.