Extra requirements for claimants (#1091)

* Introduce mandatory statement signing into claims

* Introduce SignedExtension

* Tests passing

* Bump runtime version

* Bump version, fix test

* Test for validate

* Another couple of tests

* Enable PrevalidateAttests on Polkadot

* Enable PrevalidateAttests on Polkadot

* Fix build

* Fixes

* More fixes

* Fix bench tests

* Fix & test Preclaim clobbering.

* Fix for errant claim logic

* Add test

* Update tests, always use Vec as input

* mint_claim can add signature, some_benchmarks

* Add claim with statement test

* finish benchmarks

* put the correct number of claims with benchmarks

* fix compiler warning

* Update weights

* Weight comments for validation

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Gavin Wood
2020-05-16 12:56:49 +02:00
committed by GitHub
parent b660c226d8
commit 8cb7cdbc64
23 changed files with 684 additions and 159 deletions
+19 -19
View File
@@ -2220,7 +2220,7 @@ dependencies = [
[[package]] [[package]]
name = "kusama-runtime" name = "kusama-runtime"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"frame-benchmarking", "frame-benchmarking",
@@ -4077,7 +4077,7 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e"
[[package]] [[package]]
name = "polkadot" name = "polkadot"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"assert_cmd", "assert_cmd",
"futures 0.3.5", "futures 0.3.5",
@@ -4090,7 +4090,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-availability-store" name = "polkadot-availability-store"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"derive_more 0.99.6", "derive_more 0.99.6",
"exit-future", "exit-future",
@@ -4116,7 +4116,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-cli" name = "polkadot-cli"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"frame-benchmarking-cli", "frame-benchmarking-cli",
"futures 0.3.5", "futures 0.3.5",
@@ -4140,7 +4140,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-collator" name = "polkadot-collator"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"futures 0.3.5", "futures 0.3.5",
"futures-timer 2.0.2", "futures-timer 2.0.2",
@@ -4167,7 +4167,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-erasure-coding" name = "polkadot-erasure-coding"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"derive_more 0.15.0", "derive_more 0.15.0",
"parity-scale-codec", "parity-scale-codec",
@@ -4179,7 +4179,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-network" name = "polkadot-network"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"arrayvec 0.4.12", "arrayvec 0.4.12",
"bytes 0.5.4", "bytes 0.5.4",
@@ -4228,7 +4228,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-parachain" name = "polkadot-parachain"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"derive_more 0.99.6", "derive_more 0.99.6",
"log 0.4.8", "log 0.4.8",
@@ -4247,7 +4247,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-primitives" name = "polkadot-primitives"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"frame-system", "frame-system",
@@ -4269,7 +4269,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-rpc" name = "polkadot-rpc"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"jsonrpc-core", "jsonrpc-core",
"pallet-transaction-payment-rpc", "pallet-transaction-payment-rpc",
@@ -4288,7 +4288,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-runtime" name = "polkadot-runtime"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"frame-benchmarking", "frame-benchmarking",
@@ -4357,7 +4357,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-runtime-common" name = "polkadot-runtime-common"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"frame-benchmarking", "frame-benchmarking",
@@ -4399,7 +4399,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-service" name = "polkadot-service"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"env_logger", "env_logger",
"frame-benchmarking", "frame-benchmarking",
@@ -4458,7 +4458,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-statement-table" name = "polkadot-statement-table"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"parity-scale-codec", "parity-scale-codec",
"polkadot-primitives", "polkadot-primitives",
@@ -4467,7 +4467,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-test-runtime" name = "polkadot-test-runtime"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"frame-executive", "frame-executive",
@@ -4543,7 +4543,7 @@ dependencies = [
[[package]] [[package]]
name = "polkadot-validation" name = "polkadot-validation"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"derive_more 0.14.1", "derive_more 0.14.1",
@@ -7551,7 +7551,7 @@ dependencies = [
[[package]] [[package]]
name = "test-parachain-adder" name = "test-parachain-adder"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"dlmalloc", "dlmalloc",
"parity-scale-codec", "parity-scale-codec",
@@ -7590,7 +7590,7 @@ dependencies = [
[[package]] [[package]]
name = "test-parachain-halt" name = "test-parachain-halt"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"substrate-wasm-builder-runner 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "substrate-wasm-builder-runner 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@@ -8444,7 +8444,7 @@ dependencies = [
[[package]] [[package]]
name = "westend-runtime" name = "westend-runtime"
version = "0.7.33" version = "0.7.34-dev"
dependencies = [ dependencies = [
"bitvec", "bitvec",
"frame-benchmarking", "frame-benchmarking",
+1 -1
View File
@@ -4,7 +4,7 @@ path = "src/main.rs"
[package] [package]
name = "polkadot" name = "polkadot"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,7 +1,7 @@
[package] [package]
name = "polkadot-availability-store" name = "polkadot-availability-store"
description = "Persistent database for parachain data" description = "Persistent database for parachain data"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-cli" name = "polkadot-cli"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node" description = "Polkadot Relay-chain Client Node"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-collator" name = "polkadot-collator"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation" description = "Collator node implementation"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-erasure-coding" name = "polkadot-erasure-coding"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-network" name = "polkadot-network"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol" description = "Polkadot-specific networking protocol"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-parachain" name = "polkadot-parachain"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains" description = "Types and utilities for creating and working with parachains"
edition = "2018" edition = "2018"
@@ -1,6 +1,6 @@
[package] [package]
name = "test-parachain-adder" name = "test-parachain-adder"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition" description = "Test parachain which adds to a number as its state transition"
edition = "2018" edition = "2018"
@@ -1,6 +1,6 @@
[package] [package]
name = "test-parachain-halt" name = "test-parachain-halt"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever" description = "Test parachain which executes forever"
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-primitives" name = "polkadot-primitives"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+3 -1
View File
@@ -79,12 +79,14 @@ pub use runtime_primitives::OpaqueExtrinsic as UncheckedExtrinsic;
/// Custom validity errors used in Polkadot while validating transactions. /// Custom validity errors used in Polkadot while validating transactions.
#[repr(u8)] #[repr(u8)]
pub enum ValidityError { pub enum ValidityError {
/// The ethereum signature is invalid. /// The Ethereum signature is invalid.
InvalidEthereumSignature = 0, InvalidEthereumSignature = 0,
/// The signer has no claim. /// The signer has no claim.
SignerHasNoClaim = 1, SignerHasNoClaim = 1,
/// No permission to execute the call. /// No permission to execute the call.
NoPermission = 2, NoPermission = 2,
/// An invalid statement was made for a claim.
InvalidStatement = 3,
} }
impl From<ValidityError> for u8 { impl From<ValidityError> for u8 {
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-rpc" name = "polkadot-rpc"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-runtime-common" name = "polkadot-runtime-common"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "kusama-runtime" name = "kusama-runtime"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-runtime" name = "polkadot-runtime"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+2
View File
@@ -614,6 +614,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
registrar::LimitParathreadCommits::<Runtime>::new(), registrar::LimitParathreadCommits::<Runtime>::new(),
parachains::ValidateDoubleVoteReports::<Runtime>::new(), parachains::ValidateDoubleVoteReports::<Runtime>::new(),
grandpa::ValidateEquivocationReport::<Runtime>::new(), grandpa::ValidateEquivocationReport::<Runtime>::new(),
claims::PrevalidateAttests::<Runtime>::new(),
); );
let raw_payload = SignedPayload::new(call, extra).map_err(|e| { let raw_payload = SignedPayload::new(call, extra).map_err(|e| {
debug::warn!("Unable to create signed payload: {:?}", e); debug::warn!("Unable to create signed payload: {:?}", e);
@@ -773,6 +774,7 @@ pub type SignedExtra = (
registrar::LimitParathreadCommits<Runtime>, registrar::LimitParathreadCommits<Runtime>,
parachains::ValidateDoubleVoteReports<Runtime>, parachains::ValidateDoubleVoteReports<Runtime>,
grandpa::ValidateEquivocationReport<Runtime>, grandpa::ValidateEquivocationReport<Runtime>,
claims::PrevalidateAttests<Runtime>,
); );
/// Unchecked extrinsic type as expected by this runtime. /// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>; pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-test-runtime" name = "polkadot-test-runtime"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "westend-runtime" name = "westend-runtime"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
build = "build.rs" build = "build.rs"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-service" name = "polkadot-service"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-statement-table" name = "polkadot-statement-table"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "polkadot-validation" name = "polkadot-validation"
version = "0.7.33" version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"] authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018" edition = "2018"