Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Offences report system rework #13425

Merged
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d0b6d95
Experiments with common equivocation trait
davxy Feb 13, 2023
5754be6
Improved equivocation trait
davxy Feb 15, 2023
9029a5c
Fix grandpa equivocation implementation
davxy Feb 15, 2023
0e04ca0
Remove some cruft
davxy Feb 16, 2023
d8c2598
Remove some more cruft
davxy Feb 16, 2023
1674a48
More generic naming
davxy Feb 16, 2023
6f0feff
Simplification of offences manipilation
davxy Feb 16, 2023
239bfbb
More refactory
davxy Feb 17, 2023
4ba1a01
Some prograss with the encapsulation of offence report system
davxy Feb 18, 2023
7c1c06d
Finally unit type works as a universal null report system
davxy Feb 20, 2023
1069c9d
Align substrate node code
davxy Feb 20, 2023
e096669
Further simplification
davxy Feb 20, 2023
09850ee
Fix test utils
davxy Feb 20, 2023
020e71c
Remove not required associated type
davxy Feb 20, 2023
4155c88
Fix benches
davxy Feb 20, 2023
2a3ed07
Rollback to prev field name
davxy Feb 20, 2023
5545901
Merge branch 'master' into equivocation-offence-rework
davxy Feb 20, 2023
c8a8eb6
Box big params
davxy Feb 20, 2023
9e959b7
Fix typo
davxy Feb 20, 2023
6e7e11d
Remove new tag computation
davxy Feb 20, 2023
080e82c
Remove default implementations
davxy Feb 21, 2023
3966ef7
Better docs
davxy Feb 21, 2023
5587720
Return 'Result' instead of bool
davxy Feb 23, 2023
52ee367
Change offence report system return types
davxy Feb 24, 2023
8706a6d
Some renaming and documentation
davxy Feb 24, 2023
7bebe84
Improve documentation
davxy Feb 24, 2023
f9a505b
More abstract offence report system
davxy Feb 24, 2023
aa83011
Rename 'consume_evidence' to 'process_evidence'
davxy Feb 24, 2023
0c5a536
Further docs refinements
davxy Feb 24, 2023
46b9f86
Doc for dummy offence report
davxy Feb 24, 2023
f05c4ea
Merge branch 'master' into equivocation-offence-rework
davxy Feb 24, 2023
3ff71d1
Fix rustdoc
davxy Feb 24, 2023
78f0e9f
Merge branch 'master' into equivocation-offence-rework
davxy Mar 7, 2023
d336264
Fix after master merge
davxy Mar 7, 2023
2e1c338
Apply code review suggestions
davxy Mar 7, 2023
643c745
Improve docs
davxy Mar 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions bin/node-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,12 @@ impl pallet_aura::Config for Runtime {
impl pallet_grandpa::Config for Runtime {
type RuntimeEvent = RuntimeEvent;

type KeyOwnerProofSystem = ();

type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;

type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
GrandpaId,
)>>::IdentificationTuple;

type HandleEquivocation = ();

type WeightInfo = ();
type MaxAuthorities = ConstU32<32>;
type MaxSetIdSessionEntries = ConstU64<0>;

type KeyOwnerProof = sp_core::Void;
type EquivocationReportSystem = ();
}

impl pallet_timestamp::Config for Runtime {
Expand Down
40 changes: 7 additions & 33 deletions bin/node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,24 +392,12 @@ impl pallet_babe::Config for Runtime {
type ExpectedBlockTime = ExpectedBlockTime;
type EpochChangeTrigger = pallet_babe::ExternalTrigger;
type DisabledValidators = Session;

type KeyOwnerProofSystem = Historical;

type KeyOwnerProof = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
pallet_babe::AuthorityId,
)>>::Proof;

type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
pallet_babe::AuthorityId,
)>>::IdentificationTuple;

type HandleEquivocation =
pallet_babe::EquivocationHandler<Self::KeyOwnerIdentification, Offences, ReportLongevity>;

type WeightInfo = ();
type MaxAuthorities = MaxAuthorities;
type KeyOwnerProof =
<Historical as KeyOwnerProofSystem<(KeyTypeId, pallet_babe::AuthorityId)>>::Proof;
type EquivocationReportSystem =
pallet_babe::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}

parameter_types! {
Expand Down Expand Up @@ -1320,26 +1308,12 @@ parameter_types! {

impl pallet_grandpa::Config for Runtime {
type RuntimeEvent = RuntimeEvent;

type KeyOwnerProofSystem = Historical;

type KeyOwnerProof =
<Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;

type KeyOwnerIdentification = <Self::KeyOwnerProofSystem as KeyOwnerProofSystem<(
KeyTypeId,
GrandpaId,
)>>::IdentificationTuple;

type HandleEquivocation = pallet_grandpa::EquivocationHandler<
Self::KeyOwnerIdentification,
Offences,
ReportLongevity,
>;

type WeightInfo = ();
type MaxAuthorities = MaxAuthorities;
type MaxSetIdSessionEntries = MaxSetIdSessionEntries;
type KeyOwnerProof = <Historical as KeyOwnerProofSystem<(KeyTypeId, GrandpaId)>>::Proof;
type EquivocationReportSystem =
pallet_grandpa::EquivocationReportSystem<Self, Offences, Historical, ReportLongevity>;
}

parameter_types! {
Expand Down
Loading