mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 04:45:42 +00:00
grandpa: report equivocations on all runtimes (#1000)
* grandpa: report equivocations on all runtimes * runtime: fix test-runtime compilation * runtime: enable historical session manager on all runtimes * runtime: fix indentation * runtime: use strong key types in KeyOwnerProofSystem definitions * update substrate * bump spec_version of runtimes
This commit is contained in:
@@ -92,3 +92,32 @@ impl From<ValidityError> for u8 {
|
||||
err as u8
|
||||
}
|
||||
}
|
||||
|
||||
/// App-specific crypto used for reporting equivocation/misbehavior in BABE,
|
||||
/// GRANDPA and Parachains, described in the white paper as the fisherman role.
|
||||
/// Any rewards for misbehavior reporting will be paid out to this account.
|
||||
pub mod fisherman {
|
||||
use super::{Signature, Verify};
|
||||
use primitives::crypto::KeyTypeId;
|
||||
|
||||
/// Key type for the reporting module. Used for reporting BABE, GRANDPA
|
||||
/// and Parachain equivocations.
|
||||
pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"fish");
|
||||
|
||||
mod app {
|
||||
use application_crypto::{app_crypto, sr25519};
|
||||
app_crypto!(sr25519, super::KEY_TYPE);
|
||||
}
|
||||
|
||||
/// Identity of the equivocation/misbehavior reporter.
|
||||
pub type FishermanId = app::Public;
|
||||
|
||||
/// An `AppCrypto` type to allow submitting signed transactions using the fisherman
|
||||
/// application key as signer.
|
||||
pub struct FishermanAppCrypto;
|
||||
impl system::offchain::AppCrypto<<Signature as Verify>::Signer, Signature> for FishermanAppCrypto {
|
||||
type RuntimeAppPublic = FishermanId;
|
||||
type GenericSignature = primitives::sr25519::Signature;
|
||||
type GenericPublic = primitives::sr25519::Public;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user