Slash reports (#523)

* report_slashes plumbing in Substrate

Notably delays the SetRetired event until it provides a slash report or the set
after it becomes the set to report its slashes.

* Add dedicated AcceptedHandover event

* Add SlashReport TX to Tributary

* Create SlashReport TXs

* Handle SlashReport TXs

* Add logic to generate a SlashReport to the coordinator

* Route SlashReportSigner into the processor

* Finish routing the SlashReport signing/TX publication

* Add serai feature to processor's serai-client
This commit is contained in:
Luke Parker
2024-01-29 03:48:53 -05:00
committed by GitHub
parent 0b8c7ade6e
commit 4913873b10
17 changed files with 917 additions and 67 deletions

View File

@@ -1,3 +1,5 @@
use sp_core::{ConstU32, bounded_vec::BoundedVec};
pub use serai_validator_sets_primitives as primitives;
use serai_primitives::*;
@@ -12,6 +14,11 @@ pub enum Call {
key_pair: KeyPair,
signature: Signature,
},
report_slashes {
network: NetworkId,
slashes: BoundedVec<(SeraiAddress, u32), ConstU32<{ MAX_KEY_SHARES_PER_SET / 3 }>>,
signature: Signature,
},
allocate {
network: NetworkId,
amount: Amount,
@@ -41,6 +48,12 @@ pub enum Event {
set: ValidatorSet,
key_pair: KeyPair,
},
AcceptedHandover {
set: ValidatorSet,
},
SetRetired {
set: ValidatorSet,
},
AllocationIncreased {
validator: SeraiAddress,
network: NetworkId,
@@ -57,7 +70,4 @@ pub enum Event {
network: NetworkId,
session: Session,
},
SetRetired {
set: ValidatorSet,
},
}