VRF refactory (#13889)

* First iteration to encapsulate schnorrkel and merlin usage

* Remove schnorkel direct dependency from BABE pallet

* Remove schnorrkel direct dependency from BABE client

* Trivial renaming for VrfTranscript data and value

* Better errors

* Expose a function to get a schnorrkel friendly transcript

* Keep the vrf signature stuff together (preventing some clones around)

* Fix tests

* Remove vrf agnostic transcript and define it as an associated type for VrfSigner and VrfVerifier

* Fix babe pallet mock

* Inner types are required to be public for polkadot

* Update client/consensus/babe/src/verification.rs

Co-authored-by: Koute <koute@users.noreply.github.com>

* Nit

* Remove Deref implementations

* make_bytes as a method

* Trigger CI

---------

Co-authored-by: Koute <koute@users.noreply.github.com>
This commit is contained in:
Davide Galassi
2023-04-19 11:11:47 +02:00
committed by GitHub
parent d9ad6feac0
commit bb394e08ac
28 changed files with 473 additions and 717 deletions
-20
View File
@@ -5695,7 +5695,6 @@ dependencies = [
"scale-info",
"sp-application-crypto",
"sp-consensus-babe",
"sp-consensus-vrf",
"sp-core",
"sp-io",
"sp-runtime",
@@ -8594,7 +8593,6 @@ dependencies = [
"fork-tree",
"futures",
"log",
"merlin",
"num-bigint",
"num-rational",
"num-traits",
@@ -8611,7 +8609,6 @@ dependencies = [
"sc-network-test",
"sc-telemetry",
"scale-info",
"schnorrkel",
"sp-api",
"sp-application-crypto",
"sp-block-builder",
@@ -8619,7 +8616,6 @@ dependencies = [
"sp-consensus",
"sp-consensus-babe",
"sp-consensus-slots",
"sp-consensus-vrf",
"sp-core",
"sp-inherents",
"sp-keyring",
@@ -10361,7 +10357,6 @@ name = "sp-consensus-babe"
version = "0.10.0-dev"
dependencies = [
"async-trait",
"merlin",
"parity-scale-codec",
"scale-info",
"serde",
@@ -10369,7 +10364,6 @@ dependencies = [
"sp-application-crypto",
"sp-consensus",
"sp-consensus-slots",
"sp-consensus-vrf",
"sp-core",
"sp-inherents",
"sp-keystore",
@@ -10437,18 +10431,6 @@ dependencies = [
"sp-timestamp",
]
[[package]]
name = "sp-consensus-vrf"
version = "0.10.0-dev"
dependencies = [
"parity-scale-codec",
"scale-info",
"schnorrkel",
"sp-core",
"sp-runtime",
"sp-std",
]
[[package]]
name = "sp-core"
version = "7.0.0"
@@ -10600,12 +10582,10 @@ name = "sp-keystore"
version = "0.13.0"
dependencies = [
"futures",
"merlin",
"parity-scale-codec",
"parking_lot 0.12.1",
"rand 0.7.3",
"rand_chacha 0.2.2",
"schnorrkel",
"serde",
"sp-core",
"sp-externalities",