mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
Parachains double vote handler initial implementation. (#840)
* Parachains double vote handler initial implementation. * Make tests test the actual slashing. * Implement SignedExtension validation of double vote reports. * Fixes build after merge * Review fixes * Adds historical session proofs * Review fixes. * Bump runtime spec_version * Get the session number from the proof * Check that proof matches session * Change signature type on DoubleVoteReport * Adds docs and removes blank lines * Removes leftover code * Fix build * Fix build after a merge * Apply suggestions from code review Co-Authored-By: Robert Habermeier <rphmeier@gmail.com> * Prune ParentToSessionIndex * Remove a clone and a warning Co-authored-by: Robert Habermeier <rphmeier@gmail.com> Co-authored-by: Gavin Wood <gavin@parity.io>
This commit is contained in:
@@ -34,7 +34,7 @@ use runtime_common::{attestations, claims, parachains, registrar, slots,
|
||||
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
ApplyExtrinsicResult, Perbill, RuntimeDebug,
|
||||
ApplyExtrinsicResult, Perbill, RuntimeDebug, KeyTypeId,
|
||||
transaction_validity::{TransactionValidity, InvalidTransaction, TransactionValidityError},
|
||||
curve::PiecewiseLinear,
|
||||
traits::{BlakeTwo256, Block as BlockT, StaticLookup, SignedExtension, OpaqueKeys, ConvertInto},
|
||||
@@ -46,10 +46,12 @@ use version::NativeVersion;
|
||||
use sp_core::OpaqueMetadata;
|
||||
use sp_staking::SessionIndex;
|
||||
use frame_support::{
|
||||
parameter_types, construct_runtime, traits::Randomness,
|
||||
parameter_types, construct_runtime,
|
||||
traits::{KeyOwnerProofSystem, Randomness},
|
||||
weights::DispatchInfo,
|
||||
};
|
||||
use pallet_transaction_payment_rpc_runtime_api::RuntimeDispatchInfo;
|
||||
use session::{historical as session_historical};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
pub use staking::StakerStatus;
|
||||
@@ -311,6 +313,18 @@ impl parachains::Trait for Runtime {
|
||||
type Registrar = Registrar;
|
||||
type MaxCodeSize = MaxCodeSize;
|
||||
type MaxHeadDataSize = MaxHeadDataSize;
|
||||
type Proof = session::historical::Proof;
|
||||
type KeyOwnerProofSystem = session::historical::Module<Self>;
|
||||
type IdentificationTuple = <
|
||||
Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, Vec<u8>)>
|
||||
>::IdentificationTuple;
|
||||
type ReportOffence = Offences;
|
||||
}
|
||||
|
||||
impl offences::Trait for Runtime {
|
||||
type Event = Event;
|
||||
type IdentificationTuple = session::historical::IdentificationTuple<Self>;
|
||||
type OnOffenceHandler = Staking;
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
@@ -385,6 +399,8 @@ construct_runtime! {
|
||||
// Consensus support.
|
||||
Authorship: authorship::{Module, Call, Storage},
|
||||
Staking: staking::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Offences: offences::{Module, Call, Storage, Event},
|
||||
Historical: session_historical::{Module},
|
||||
Session: session::{Module, Call, Storage, Event, Config<T>},
|
||||
Grandpa: grandpa::{Module, Call, Storage, Config, Event},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user