babe: report equivocations (#6362)

* slots: create primitives crate for consensus slots

* offences: add method to check if an offence is unknown

* babe: initial equivocation reporting implementation

* babe: organize imports

* babe: working equivocation reporting

* babe: add slot number to equivocation proof

* session: move duplicate traits to session primitives

* babe: move equivocation stuff to its own file

* offences: fix test

* session: don't have primitives depend on frame_support

* babe: use opaque type for key owner proof

* babe: cleanup client equivocation reporting

* babe: cleanup equivocation code in pallet

* babe: allow sending signed equivocation reports

* node: fix compilation

* fix test compilation

* babe: return bool on check_equivocation_proof

* babe: add test for equivocation reporting

* babe: add more tests

* babe: add test for validate unsigned

* babe: take slot number in generate_key_ownership_proof API

* babe: add benchmark for equivocation proof checking

* session: add benchmark for membership proof checking

* offences: fix babe benchmark

* babe: add weights based on benchmark results

* babe: adjust weights after benchmarking on reference hardware

* babe: reorder checks in check_and_report_equivocation
This commit is contained in:
André Silva
2020-07-04 11:18:13 +01:00
committed by GitHub
parent 61635e75c1
commit a9c21b8b84
34 changed files with 2031 additions and 275 deletions
+19
View File
@@ -4009,9 +4009,15 @@ dependencies = [
name = "pallet-babe"
version = "2.0.0-rc4"
dependencies = [
"frame-benchmarking",
"frame-support",
"frame-system",
"pallet-authorship",
"pallet-balances",
"pallet-offences",
"pallet-session",
"pallet-staking",
"pallet-staking-reward-curve",
"pallet-timestamp",
"parity-scale-codec",
"serde",
@@ -4022,6 +4028,7 @@ dependencies = [
"sp-inherents",
"sp-io",
"sp-runtime",
"sp-session",
"sp-staking",
"sp-std",
"sp-timestamp",
@@ -4554,10 +4561,12 @@ dependencies = [
"pallet-staking-reward-curve",
"pallet-timestamp",
"parity-scale-codec",
"rand 0.7.3",
"serde",
"sp-core",
"sp-io",
"sp-runtime",
"sp-session",
"sp-std",
]
@@ -6343,6 +6352,7 @@ dependencies = [
"sp-application-crypto",
"sp-blockchain",
"sp-consensus",
"sp-consensus-slots",
"sp-core",
"sp-inherents",
"sp-runtime",
@@ -7568,6 +7578,7 @@ dependencies = [
"sp-api",
"sp-application-crypto",
"sp-consensus",
"sp-consensus-slots",
"sp-consensus-vrf",
"sp-core",
"sp-inherents",
@@ -7587,6 +7598,14 @@ dependencies = [
"sp-std",
]
[[package]]
name = "sp-consensus-slots"
version = "0.8.0-rc4"
dependencies = [
"parity-scale-codec",
"sp-runtime",
]
[[package]]
name = "sp-consensus-vrf"
version = "0.8.0-rc4"