Unverified Commit d8328043 authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

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's avatarShawn Tabrizi <shawntabrizi@gmail.com>
parent 67af396c
Pipeline #92938 passed with stages
in 22 minutes and 41 seconds
......@@ -2220,7 +2220,7 @@ dependencies = [
[[package]]
name = "kusama-runtime"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"frame-benchmarking",
......@@ -4077,7 +4077,7 @@ checksum = "feb3b2b1033b8a60b4da6ee470325f887758c95d5320f52f9ce0df055a55940e"
[[package]]
name = "polkadot"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"assert_cmd",
"futures 0.3.5",
......@@ -4090,7 +4090,7 @@ dependencies = [
[[package]]
name = "polkadot-availability-store"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"derive_more 0.99.6",
"exit-future",
......@@ -4116,7 +4116,7 @@ dependencies = [
[[package]]
name = "polkadot-cli"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"frame-benchmarking-cli",
"futures 0.3.5",
......@@ -4140,7 +4140,7 @@ dependencies = [
[[package]]
name = "polkadot-collator"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"futures 0.3.5",
"futures-timer 2.0.2",
......@@ -4167,7 +4167,7 @@ dependencies = [
[[package]]
name = "polkadot-erasure-coding"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"derive_more 0.15.0",
"parity-scale-codec",
......@@ -4179,7 +4179,7 @@ dependencies = [
[[package]]
name = "polkadot-network"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"arrayvec 0.4.12",
"bytes 0.5.4",
......@@ -4228,7 +4228,7 @@ dependencies = [
[[package]]
name = "polkadot-parachain"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"derive_more 0.99.6",
"log 0.4.8",
......@@ -4247,7 +4247,7 @@ dependencies = [
[[package]]
name = "polkadot-primitives"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"frame-system",
......@@ -4269,7 +4269,7 @@ dependencies = [
[[package]]
name = "polkadot-rpc"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"jsonrpc-core",
"pallet-transaction-payment-rpc",
......@@ -4288,7 +4288,7 @@ dependencies = [
[[package]]
name = "polkadot-runtime"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"frame-benchmarking",
......@@ -4357,7 +4357,7 @@ dependencies = [
[[package]]
name = "polkadot-runtime-common"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"frame-benchmarking",
......@@ -4399,7 +4399,7 @@ dependencies = [
[[package]]
name = "polkadot-service"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"env_logger",
"frame-benchmarking",
......@@ -4458,7 +4458,7 @@ dependencies = [
[[package]]
name = "polkadot-statement-table"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"parity-scale-codec",
"polkadot-primitives",
......@@ -4467,7 +4467,7 @@ dependencies = [
[[package]]
name = "polkadot-test-runtime"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"frame-executive",
......@@ -4543,7 +4543,7 @@ dependencies = [
[[package]]
name = "polkadot-validation"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"derive_more 0.14.1",
......@@ -7551,7 +7551,7 @@ dependencies = [
[[package]]
name = "test-parachain-adder"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"dlmalloc",
"parity-scale-codec",
......@@ -7590,7 +7590,7 @@ dependencies = [
[[package]]
name = "test-parachain-halt"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"substrate-wasm-builder-runner 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
......@@ -8444,7 +8444,7 @@ dependencies = [
[[package]]
name = "westend-runtime"
version = "0.7.33"
version = "0.7.34-dev"
dependencies = [
"bitvec",
"frame-benchmarking",
......
......@@ -4,7 +4,7 @@ path = "src/main.rs"
[package]
name = "polkadot"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-availability-store"
description = "Persistent database for parachain data"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-cli"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot Relay-chain Client Node"
edition = "2018"
......
[package]
name = "polkadot-collator"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Collator node implementation"
edition = "2018"
......
[package]
name = "polkadot-erasure-coding"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-network"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot-specific networking protocol"
edition = "2018"
......
[package]
name = "polkadot-parachain"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Types and utilities for creating and working with parachains"
edition = "2018"
......
[package]
name = "test-parachain-adder"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which adds to a number as its state transition"
edition = "2018"
......
[package]
name = "test-parachain-halt"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Test parachain which executes forever"
edition = "2018"
......
[package]
name = "polkadot-primitives"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
......@@ -79,12 +79,14 @@ pub use runtime_primitives::OpaqueExtrinsic as UncheckedExtrinsic;
/// Custom validity errors used in Polkadot while validating transactions.
#[repr(u8)]
pub enum ValidityError {
/// The ethereum signature is invalid.
/// The Ethereum signature is invalid.
InvalidEthereumSignature = 0,
/// The signer has no claim.
SignerHasNoClaim = 1,
/// No permission to execute the call.
NoPermission = 2,
/// An invalid statement was made for a claim.
InvalidStatement = 3,
}
impl From<ValidityError> for u8 {
......
[package]
name = "polkadot-rpc"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
[package]
name = "polkadot-runtime-common"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
......
This diff is collapsed.
[package]
name = "kusama-runtime"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......
[package]
name = "polkadot-runtime"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......
......@@ -614,6 +614,7 @@ impl<LocalCall> system::offchain::CreateSignedTransaction<LocalCall> for Runtime
registrar::LimitParathreadCommits::<Runtime>::new(),
parachains::ValidateDoubleVoteReports::<Runtime>::new(),
grandpa::ValidateEquivocationReport::<Runtime>::new(),
claims::PrevalidateAttests::<Runtime>::new(),
);
let raw_payload = SignedPayload::new(call, extra).map_err(|e| {
debug::warn!("Unable to create signed payload: {:?}", e);
......@@ -773,6 +774,7 @@ pub type SignedExtra = (
registrar::LimitParathreadCommits<Runtime>,
parachains::ValidateDoubleVoteReports<Runtime>,
grandpa::ValidateEquivocationReport<Runtime>,
claims::PrevalidateAttests<Runtime>,
);
/// Unchecked extrinsic type as expected by this runtime.
pub type UncheckedExtrinsic = generic::UncheckedExtrinsic<Address, Call, Signature, SignedExtra>;
......
[package]
name = "polkadot-test-runtime"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......
[package]
name = "westend-runtime"
version = "0.7.33"
version = "0.7.34-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
build = "build.rs"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment