::get(&sender).ok_or("NonExistentAccount")?;
- let reminder = sender_balance.checked_sub(amount).ok_or("NotEnoughBalance")?;
+ let remainder = sender_balance.checked_sub(amount).ok_or("NotEnoughBalance")?;
// .. snip
Ok(())
--
GitLab
From ea80adfdbc477c54d1cda9f6e911f917acc3af17 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Sat, 31 Aug 2024 00:45:15 +0200
Subject: [PATCH 005/218] Bump the known_good_semver group across 1 directory
with 5 updates (#5460)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Bumps the known_good_semver group with 4 updates in the / directory:
[quote](https://github.com/dtolnay/quote),
[serde](https://github.com/serde-rs/serde),
[serde_json](https://github.com/serde-rs/json) and
[syn](https://github.com/dtolnay/syn).
Updates `quote` from 1.0.36 to 1.0.37
Release notes
Sourced from quote's
releases.
1.0.37
- Implement ToTokens for CStr and CString (#283)
Commits
b1ebffa
Release 1.0.37
43acd77
Delete unneeded use of ref
9382c21
Merge pull request #283
from dtolnay/cstr
6ac4328
Add C string tests
9fb0591
Implement ToTokens for CStr and CString
ba7a9d0
Organize test imports
aa9970f
Inline the macro that generates primitive impls
ba41109
Merge pull request #282
from dtolnay/tokens
c77340a
Consistently use 'tokens' as the name of the &mut TokenStream
arg
a4a0abf
Merge pull request #281
from dtolnay/char
- Additional commits viewable in compare
view
Updates `serde` from 1.0.206 to 1.0.209
Release notes
Sourced from serde's
releases.
v1.0.209
- Fix deserialization of empty structs and empty tuples inside of
untagged enums (#2805,
thanks
@Mingun
)
v1.0.208
- Support serializing and deserializing unit structs in a
flatten
field (#2802,
thanks @jonhoo
)
v1.0.207
- Improve interactions between
flatten
attribute and
skip_serializing
/skip_deserializing
(#2795,
thanks @Mingun
)
Commits
30752ac
Release 1.0.209
b84e6ca
Improve wording of PR 2805 comments
87a2fb0
Wrap comments from PR 2805 to 80 columns
9eaf7b9
Merge pull request #2805
from Mingun/untagged-tests
7bde100
Replace MapRefDeserializer with value::MapDeserializer
da7fc79
Fix deserialization of empty struct variant in untagged enums
4c5fec1
Test special cases that reaches SeqRefDeserializer::deserialize_any
len==0 co...
6588b0a
Cover Content::Seq case in VariantRefDeserializer::struct_variant
0093f74
Split test newtype_enum into four tests for each variant
171c6da
Complete coverage of
ContentRefDeserializer::deserialize_newtype_struct
- Additional commits viewable in compare
view
Updates `serde_derive` from 1.0.206 to 1.0.209
Release notes
Sourced from serde_derive's
releases.
v1.0.209
- Fix deserialization of empty structs and empty tuples inside of
untagged enums (#2805,
thanks
@Mingun
)
v1.0.208
- Support serializing and deserializing unit structs in a
flatten
field (#2802,
thanks @jonhoo
)
v1.0.207
- Improve interactions between
flatten
attribute and
skip_serializing
/skip_deserializing
(#2795,
thanks @Mingun
)
Commits
30752ac
Release 1.0.209
b84e6ca
Improve wording of PR 2805 comments
87a2fb0
Wrap comments from PR 2805 to 80 columns
9eaf7b9
Merge pull request #2805
from Mingun/untagged-tests
7bde100
Replace MapRefDeserializer with value::MapDeserializer
da7fc79
Fix deserialization of empty struct variant in untagged enums
4c5fec1
Test special cases that reaches SeqRefDeserializer::deserialize_any
len==0 co...
6588b0a
Cover Content::Seq case in VariantRefDeserializer::struct_variant
0093f74
Split test newtype_enum into four tests for each variant
171c6da
Complete coverage of
ContentRefDeserializer::deserialize_newtype_struct
- Additional commits viewable in compare
view
Updates `serde_json` from 1.0.124 to 1.0.127
Release notes
Sourced from serde_json's
releases.
1.0.127
- Add more removal methods to OccupiedEntry (#1179,
thanks
@GREsau
)
1.0.126
- Improve string parsing on targets that use 32-bit pointers but also
have fast 64-bit integer arithmetic, such as
aarch64-unknown-linux-gnu_ilp32 and x86_64-unknown-linux-gnux32 (#1182,
thanks
@CryZe
)
1.0.125
- Speed up \uXXXX parsing and improve handling of unpaired surrogates
when deserializing to bytes (#1172,
#1175,
thanks
@purplesyringa
)
Commits
5ebf65c
Release 1.0.127
f287a3b
Merge pull request 1179 from GREsau/patch-1
ec980b0
Release 1.0.126
e6282b0
Merge pull request #1184
from serde-rs/fastarithmetic
ffc4a43
Improve cfg names for fast arithmetic
4b1048d
Merge pull request #1183
from serde-rs/arithmetic
f268173
Unify chunk size choice between float and string parsing
fec0376
Merge pull request #1182
from CryZe/chunk-64bit
3d837e1
Ensure the SWAR chunks are 64-bit in more cases
11fc61c
Add OccupiedEntry::shift_remove()
and
swap_remove()
- Additional commits viewable in compare
view
Updates `syn` from 2.0.61 to 2.0.65
Release notes
Sourced from syn's
releases.
2.0.65
- Optimize the implementation of
Fold
to compile faster
(#1666, #1667, #1668)
2.0.64
- Support using ParseBuffer across
catch_unwind
(#1646)
- Validate that the expression in a let-else ends in brace as required
by rustc (#1648, #1649)
- Legalize invalid const generic arguments by wrapping in braces (#1654, #1655)
- Fix some expression precedence edge cases involving
break
and return
in loop headers (#1656)
- Always print closure bodies with a brace when the closure has an
explicit return type (#1658)
- Automatically insert necessary parentheses in ToTokens for Expr when
required by expression precedence (#1659)
- Support struct literal syntax in match guard expressions (#1662)
2.0.63
- Parse and print long if-else-if chains without reliance on deep
recursion to avoid overflowing stack (#1644, #1645)
2.0.62
- Reject invalid unparenthesized range and comparison operator
expressions (#1642, #1643)
Commits
9f2371e
Release 2.0.65
4cd1813
Merge pull request #1668
from dtolnay/foldhelper
ed54092
Eliminate gen::helper module
eacc8ab
Eliminate FoldHelper trait
6e20bb8
Merge pull request #1667
from dtolnay/punctuatedfold
9d95cab
Optimize punctuated::fold
82ffe86
Move Punctuated fold helper to punctuated module
3dfacc1
Ignore manual_map clippy lint
7273aa7
Merge pull request #1666
from dtolnay/foldhelper
8124c0e
Generate fewer monomorphizations in Fold
- Additional commits viewable in compare
view
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore ` will
remove the ignore condition of the specified dependency and ignore
conditions
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Cargo.lock | 398 ++++++++++++++++++++++++++---------------------------
Cargo.toml | 8 +-
2 files changed, 203 insertions(+), 203 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 3eaa7c24e30..d81a9f23e81 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -158,8 +158,8 @@ dependencies = [
"heck 0.4.1",
"proc-macro-error",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
"syn-solidity",
"tiny-keccak",
]
@@ -285,8 +285,8 @@ dependencies = [
"itertools 0.10.5",
"proc-macro-error",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -484,7 +484,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44"
dependencies = [
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -494,7 +494,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348"
dependencies = [
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -506,7 +506,7 @@ checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20"
dependencies = [
"num-bigint",
"num-traits",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -519,7 +519,7 @@ dependencies = [
"num-bigint",
"num-traits",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -621,7 +621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -725,7 +725,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
"synstructure 0.12.6",
]
@@ -737,8 +737,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
"synstructure 0.13.1",
]
@@ -749,7 +749,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -760,8 +760,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -1098,7 +1098,7 @@ version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5"
dependencies = [
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -1288,8 +1288,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -1305,8 +1305,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -1364,7 +1364,7 @@ checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89"
dependencies = [
"proc-macro-error",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -1501,11 +1501,11 @@ dependencies = [
"peeking_take_while",
"prettyplease 0.2.12",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"regex",
"rustc-hash 1.1.0",
"shlex",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -2820,7 +2820,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro-error",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -2832,8 +2832,8 @@ checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e"
dependencies = [
"heck 0.5.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -3020,7 +3020,7 @@ checksum = "d51beaa537d73d2d1ff34ee70bc095f170420ab2ec5d687ecd3ec2b0d092514b"
dependencies = [
"nom",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -4143,8 +4143,8 @@ version = "0.6.0"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -4678,8 +4678,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -4717,9 +4717,9 @@ dependencies = [
"codespan-reporting",
"once_cell",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"scratch",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -4735,8 +4735,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50c49547d73ba8dcfd4ad7325d64c6d5391ff4224d498fc39a6f3f49825a530d"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -4841,7 +4841,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -4852,8 +4852,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -4863,8 +4863,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -4875,7 +4875,7 @@ checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321"
dependencies = [
"convert_case",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"rustc_version 0.4.0",
"syn 1.0.109",
]
@@ -4971,8 +4971,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -5031,9 +5031,9 @@ dependencies = [
"derive-syn-parse",
"once_cell",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"regex",
- "syn 2.0.61",
+ "syn 2.0.65",
"termcolor",
"toml 0.8.8",
"walkdir",
@@ -5080,7 +5080,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "558e40ea573c374cf53507fd240b7ee2f5477df7cfebdb97323ec61c719399c5"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -5226,7 +5226,7 @@ checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116"
dependencies = [
"heck 0.4.1",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -5238,8 +5238,8 @@ checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a"
dependencies = [
"heck 0.4.1",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -5258,8 +5258,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e9a1f9f7d83e59740248a6e14ecf93929ade55027844dfcea78beafccc15745"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -5269,8 +5269,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -5472,8 +5472,8 @@ dependencies = [
"fs-err",
"prettyplease 0.2.12",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -5544,8 +5544,8 @@ dependencies = [
"indexmap 2.2.3",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -5876,10 +5876,10 @@ dependencies = [
"parity-scale-codec",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"scale-info",
"sp-arithmetic",
- "syn 2.0.61",
+ "syn 2.0.65",
"trybuild",
]
@@ -6071,7 +6071,7 @@ dependencies = [
"pretty_assertions",
"proc-macro-warning 1.0.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"regex",
"scale-info",
"sp-core",
@@ -6080,7 +6080,7 @@ dependencies = [
"sp-metadata-ir",
"sp-runtime",
"static_assertions",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -6090,8 +6090,8 @@ dependencies = [
"frame-support-procedural-tools-derive",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -6099,8 +6099,8 @@ name = "frame-support-procedural-tools-derive"
version = "11.0.0"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -6350,8 +6350,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -7143,7 +7143,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -7163,7 +7163,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
]
[[package]]
@@ -7522,8 +7522,8 @@ dependencies = [
"heck 0.5.0",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -8108,8 +8108,8 @@ dependencies = [
"heck 0.4.1",
"proc-macro-warning 0.4.2",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -8522,8 +8522,8 @@ checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d"
dependencies = [
"macro_magic_core",
"macro_magic_macros",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -8536,8 +8536,8 @@ dependencies = [
"derive-syn-parse",
"macro_magic_core_macros",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -8547,8 +8547,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -8558,8 +8558,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869"
dependencies = [
"macro_magic_core",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -8892,7 +8892,7 @@ checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb"
dependencies = [
"cfg-if",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -8904,8 +8904,8 @@ checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2"
dependencies = [
"cfg-if",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -9016,7 +9016,7 @@ dependencies = [
"proc-macro-crate 1.3.1",
"proc-macro-error",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
"synstructure 0.12.6",
]
@@ -9064,7 +9064,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -9455,8 +9455,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -9631,8 +9631,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -9698,7 +9698,7 @@ dependencies = [
"petgraph",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -10402,8 +10402,8 @@ name = "pallet-contracts-proc-macro"
version = "18.0.0"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -11502,8 +11502,8 @@ name = "pallet-revive-proc-macro"
version = "0.1.0"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -11746,9 +11746,9 @@ version = "11.0.0"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"sp-runtime",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -12392,7 +12392,7 @@ checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -12839,8 +12839,8 @@ dependencies = [
"pest",
"pest_meta",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -12880,8 +12880,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -15289,8 +15289,8 @@ checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c"
dependencies = [
"polkavm-common 0.9.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -15301,8 +15301,8 @@ checksum = "7855353a5a783dd5d09e3b915474bddf66575f5a3cf45dec8d1c5e051ba320dc"
dependencies = [
"polkavm-common 0.10.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -15312,7 +15312,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429"
dependencies = [
"polkavm-derive-impl 0.9.0",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -15322,7 +15322,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9324fe036de37c17829af233b46ef6b5562d4a0c09bb7fdb9f8378856dee30cf"
dependencies = [
"polkavm-derive-impl 0.10.0",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -15549,7 +15549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6c64d9ba0963cdcea2e1b2230fbae2bab30eb25a174be395c41e764bfb65dd62"
dependencies = [
"proc-macro2 1.0.82",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -15610,7 +15610,7 @@ checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
"proc-macro-error-attr",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
"version_check",
]
@@ -15622,7 +15622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"version_check",
]
@@ -15639,8 +15639,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -15650,8 +15650,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b698b0b09d40e9b7c1a47b132d66a8b54bcd20583d9b6d06e4535e383b4405c"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -15731,8 +15731,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -15826,7 +15826,7 @@ dependencies = [
"prost 0.12.6",
"prost-types 0.12.4",
"regex",
- "syn 2.0.61",
+ "syn 2.0.65",
"tempfile",
]
@@ -15839,7 +15839,7 @@ dependencies = [
"anyhow",
"itertools 0.10.5",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -15852,8 +15852,8 @@ dependencies = [
"anyhow",
"itertools 0.11.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -16087,9 +16087,9 @@ dependencies = [
[[package]]
name = "quote"
-version = "1.0.36"
+version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7"
+checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2 1.0.82",
]
@@ -16291,8 +16291,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -16841,11 +16841,11 @@ dependencies = [
"cfg-if",
"glob",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"regex",
"relative-path",
"rustc_version 0.4.0",
- "syn 2.0.61",
+ "syn 2.0.65",
"unicode-ident",
]
@@ -17335,8 +17335,8 @@ version = "11.0.0"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -18630,8 +18630,8 @@ version = "11.0.0"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -18744,7 +18744,7 @@ checksum = "2d35494501194174bda522a32605929eefc9ecf7e0a326c26db1fdd85881eb62"
dependencies = [
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -18782,7 +18782,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"serde_derive_internals",
"syn 1.0.109",
]
@@ -19050,9 +19050,9 @@ checksum = "f97841a747eef040fcd2e7b3b9a220a7205926e60488e673d9e4926d27772ce5"
[[package]]
name = "serde"
-version = "1.0.206"
+version = "1.0.209"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284"
+checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
dependencies = [
"serde_derive",
]
@@ -19077,13 +19077,13 @@ dependencies = [
[[package]]
name = "serde_derive"
-version = "1.0.206"
+version = "1.0.209"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97"
+checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -19093,7 +19093,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -19108,9 +19108,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.124"
+version = "1.0.127"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d"
+checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad"
dependencies = [
"indexmap 2.2.3",
"itoa",
@@ -19184,8 +19184,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -20059,8 +20059,8 @@ dependencies = [
"expander",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -20443,9 +20443,9 @@ dependencies = [
name = "sp-crypto-hashing-proc-macro"
version = "0.1.0"
dependencies = [
- "quote 1.0.36",
+ "quote 1.0.37",
"sp-crypto-hashing",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -20462,8 +20462,8 @@ version = "8.0.0"
source = "git+https://github.com/paritytech/polkadot-sdk#82912acb33a9030c0ef3bf590a34fca09b72dc5f"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -20471,8 +20471,8 @@ name = "sp-debug-derive"
version = "14.0.0"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -20743,8 +20743,8 @@ dependencies = [
"Inflector",
"proc-macro-crate 1.3.1",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -20755,8 +20755,8 @@ dependencies = [
"expander",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -21016,9 +21016,9 @@ version = "13.0.0"
dependencies = [
"parity-scale-codec",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"sp-version",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -21101,7 +21101,7 @@ dependencies = [
"Inflector",
"num-format",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"serde",
"serde_json",
"unicode-xid 0.2.4",
@@ -21126,7 +21126,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f07d54c4d01a1713eb363b55ba51595da15f6f1211435b71466460da022aa140"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -21319,7 +21319,7 @@ dependencies = [
"cfg_aliases",
"memchr",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -21392,7 +21392,7 @@ dependencies = [
"heck 0.3.3",
"proc-macro-error",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -21428,7 +21428,7 @@ checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59"
dependencies = [
"heck 0.4.1",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"rustversion",
"syn 1.0.109",
]
@@ -21441,9 +21441,9 @@ checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0"
dependencies = [
"heck 0.4.1",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"rustversion",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -21454,9 +21454,9 @@ checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946"
dependencies = [
"heck 0.4.1",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"rustversion",
- "syn 2.0.61",
+ "syn 2.0.65",
]
[[package]]
@@ -21904,18 +21904,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"unicode-ident",
]
[[package]]
name = "syn"
-version = "2.0.61"
+version = "2.0.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9"
+checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"unicode-ident",
]
@@ -21927,8 +21927,8 @@ checksum = "86b837ef12ab88835251726eb12237655e61ec8dc8a280085d1961cdc3dfd047"
dependencies = [
"paste",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -21938,7 +21938,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
"unicode-xid 0.2.4",
]
@@ -21950,8 +21950,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -22069,8 +22069,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -22233,7 +22233,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "10ac1c5050e43014d16b2f94d0d2ce79e65ffdd8b38d8048f9c8f6a8a6da62ac"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"syn 1.0.109",
]
@@ -22244,8 +22244,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -22410,8 +22410,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -22617,8 +22617,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -22659,8 +22659,8 @@ dependencies = [
"expander",
"proc-macro-crate 3.1.0",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -23230,8 +23230,8 @@ dependencies = [
"log",
"once_cell",
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
"wasm-bindgen-shared",
]
@@ -23253,7 +23253,7 @@ version = "0.2.93"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf"
dependencies = [
- "quote 1.0.36",
+ "quote 1.0.37",
"wasm-bindgen-macro-support",
]
@@ -23264,8 +23264,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@@ -23297,7 +23297,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ecb993dd8c836930ed130e020e77d9b2e65dd0fbab1b67c790b0f5d80b11a575"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
]
[[package]]
@@ -24363,9 +24363,9 @@ version = "7.0.0"
dependencies = [
"Inflector",
"proc-macro2 1.0.82",
- "quote 1.0.36",
+ "quote 1.0.37",
"staging-xcm",
- "syn 2.0.61",
+ "syn 2.0.65",
"trybuild",
]
@@ -24529,8 +24529,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
@@ -24549,8 +24549,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2 1.0.82",
- "quote 1.0.36",
- "syn 2.0.61",
+ "quote 1.0.37",
+ "syn 2.0.65",
]
[[package]]
diff --git a/Cargo.toml b/Cargo.toml
index 7cd18bc8a59..24694b185ae 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1090,7 +1090,7 @@ pyroscope = { version = "0.5.7" }
pyroscope_pprofrs = { version = "0.2.7" }
quick_cache = { version = "0.3" }
quickcheck = { version = "1.0.3", default-features = false }
-quote = { version = "1.0.36" }
+quote = { version = "1.0.37" }
rand = { version = "0.8.5", default-features = false }
rand_chacha = { version = "0.3.1", default-features = false }
rand_core = { version = "0.6.2" }
@@ -1185,10 +1185,10 @@ secp256k1 = { version = "0.28.0", default-features = false }
secrecy = { version = "0.8.0", default-features = false }
seedling-runtime = { path = "cumulus/parachains/runtimes/starters/seedling" }
separator = { version = "0.4.1" }
-serde = { version = "1.0.206", default-features = false }
+serde = { version = "1.0.209", default-features = false }
serde-big-array = { version = "0.3.2" }
serde_derive = { version = "1.0.117" }
-serde_json = { version = "1.0.124", default-features = false }
+serde_json = { version = "1.0.127", default-features = false }
serde_yaml = { version = "0.9" }
serial_test = { version = "2.0.0" }
sha1 = { version = "0.10.6" }
@@ -1297,7 +1297,7 @@ substrate-test-runtime-client = { path = "substrate/test-utils/runtime/client" }
substrate-test-runtime-transaction-pool = { path = "substrate/test-utils/runtime/transaction-pool" }
substrate-test-utils = { path = "substrate/test-utils" }
substrate-wasm-builder = { path = "substrate/utils/wasm-builder", default-features = false }
-syn = { version = "2.0.53" }
+syn = { version = "2.0.65" }
sysinfo = { version = "0.30" }
tar = { version = "0.4" }
tempfile = { version = "3.8.1" }
--
GitLab
From 9cf6c5bc6cbf470c1b3c239b360f522e6826ce74 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Alexander=20Thei=C3=9Fen?=
Date: Sat, 31 Aug 2024 12:35:40 +0200
Subject: [PATCH 006/218] Update CODEOWNERS for contracts (#5537)
Added the new contracts pallet and also added @pgherveou as code owners.
---
.github/CODEOWNERS | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 4fc5b97caae..34335822121 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -64,7 +64,8 @@
/substrate/primitives/merkle-mountain-range/ @acatangiu
# Contracts
-/substrate/frame/contracts/ @athei @paritytech/docs-audit
+/substrate/frame/contracts/ @athei @pgherveou @paritytech/docs-audit
+/substrate/frame/revive/ @athei @pgherveou @paritytech/docs-audit
# NPoS and election
/substrate/frame/election-provider-multi-phase/ @paritytech/staking-core @paritytech/docs-audit
--
GitLab
From b7d5f15aede020d65b2b9634e858dac863c0520a Mon Sep 17 00:00:00 2001
From: Maksym H <1177472+mordamax@users.noreply.github.com>
Date: Sat, 31 Aug 2024 12:13:52 +0100
Subject: [PATCH 007/218] Update cmd.yml (#5536)
Tiny fix for subweight diff in /cmd
---
.github/workflows/cmd.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/cmd.yml b/.github/workflows/cmd.yml
index 7a742751005..dfdf771a610 100644
--- a/.github/workflows/cmd.yml
+++ b/.github/workflows/cmd.yml
@@ -380,7 +380,7 @@ jobs:
--no-color \
--change added changed \
--ignore-errors \
- refs/remotes/origin/master ${{ github.ref }})
+ refs/remotes/origin/master refs/heads/${{ needs.get-pr-branch.outputs.pr-branch }})
# Save the multiline result to the output
{
--
GitLab
From f0b2add13a741e21d91c7ccb5f26bb2685315e5d Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 2 Sep 2024 08:57:14 +0000
Subject: [PATCH 008/218] Bump color-eyre from 0.6.2 to 0.6.3 (#5543)
Bumps [color-eyre](https://github.com/eyre-rs/eyre) from 0.6.2 to 0.6.3.
Commits
f544fed
chore: Release
7689b98
chore: don't inherit workspace readme
63cb412
chore: remove old metadata
7e7e173
chore: update changelog
7a5c32a
Add color-eyre to workspace (#110)
eb8d059
Merge remote-tracking branch 'origin/master' into color-eyre
75beaae
fix: remove anyhow
feature flag from OptionExt
location test (#148)
e570151
color-spantrace: bump owo-colors to 4.0 (#156)
cb4bab6
chore: update issues redirect
8ebc308
fix: make theme test more lenient
- Additional commits viewable in compare
view
[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=color-eyre&package-manager=cargo&previous-version=0.6.2&new-version=0.6.3)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
Signed-off-by: dependabot[bot]
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
---
Cargo.lock | 4 ++--
Cargo.toml | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index d81a9f23e81..4cb69d1a178 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2992,9 +2992,9 @@ dependencies = [
[[package]]
name = "color-eyre"
-version = "0.6.2"
+version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204"
+checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5"
dependencies = [
"backtrace",
"eyre",
diff --git a/Cargo.toml b/Cargo.toml
index 24694b185ae..f8c430f5825 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -673,7 +673,7 @@ coarsetime = { version = "0.1.22" }
codec = { version = "3.6.12", default-features = false, package = "parity-scale-codec" }
collectives-westend-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/collectives/collectives-westend" }
collectives-westend-runtime = { path = "cumulus/parachains/runtimes/collectives/collectives-westend" }
-color-eyre = { version = "0.6.1", default-features = false }
+color-eyre = { version = "0.6.3", default-features = false }
color-print = { version = "0.3.4" }
colored = { version = "2.0.4" }
comfy-table = { version = "7.1.0", default-features = false }
--
GitLab
From 6b854acc69cd64f7c0e6cdb606e741e630e45032 Mon Sep 17 00:00:00 2001
From: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com>
Date: Mon, 2 Sep 2024 12:05:03 +0300
Subject: [PATCH 009/218] [3 / 5] Move crypto checks in the
approval-distribution (#4928)
# Prerequisite
This is part of the work to further optimize the approval subsystems, if
you want to understand the full context start with reading
https://github.com/paritytech/polkadot-sdk/pull/4849#issue-2364261568,
# Description
This PR contain changes, so that the crypto checks are performed by the
approval-distribution subsystem instead of the approval-voting one. The
benefit for these, is twofold:
1. Approval-distribution won't have to wait every single time for the
approval-voting to finish its job, so the work gets to be pipelined
between approval-distribution and approval-voting.
2. By running in parallel multiple instances of approval-distribution as
described here
https://github.com/paritytech/polkadot-sdk/pull/4849#issue-2364261568,
this significant body of work gets to run in parallel.
## Changes:
1. When approval-voting send `ApprovalDistributionMessage::NewBlocks` it
needs to pass the core_index and candidate_hash of the candidates.
2. ApprovalDistribution needs to use `RuntimeInfo` to be able to fetch
the SessionInfo from the runtime.
3. Move `approval-voting` logic that checks VRF assignment into
`approval-distribution`
4. Move `approval-voting` logic that checks vote is correctly signed
into `approval-distribution`
5. Plumb `approval-distribution` and `approval-voting` tests to support
the new logic.
## Benefits
Even without parallelisation the gains are significant, for example on
my machine if we run approval subsystem bench for 500 validators and 100
cores and trigger all 89 tranches of assignments and approvals, the
system won't fall behind anymore because of late processing of messages.
```
Before change
Chain selection approved after 11500 ms hash=0x0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a
After change
Chain selection approved after 5500 ms hash=0x0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a
```
## TODO:
- [x] Run on versi.
- [x] Update parachain host documentation.
---------
Signed-off-by: Alexandru Gheorghe
---
Cargo.lock | 5 +
.../approval-voting-regression-bench.rs | 4 +-
.../approval-voting/src/approval_checking.rs | 8 +-
.../node/core/approval-voting/src/criteria.rs | 174 +-
.../node/core/approval-voting/src/import.rs | 12 +-
polkadot/node/core/approval-voting/src/lib.rs | 239 +-
.../approval-voting/src/persisted_entries.rs | 4 +-
.../node/core/approval-voting/src/tests.rs | 464 +-
.../network/approval-distribution/Cargo.toml | 2 +
.../network/approval-distribution/src/lib.rs | 500 +-
.../approval-distribution/src/metrics.rs | 16 -
.../approval-distribution/src/tests.rs | 6307 ++++++++++-------
polkadot/node/overseer/src/lib.rs | 1 +
polkadot/node/primitives/Cargo.toml | 3 +
.../node/primitives/src/approval/criteria.rs | 177 +
.../src/{approval.rs => approval/mod.rs} | 14 +-
.../src => primitives/src/approval}/time.rs | 13 +-
polkadot/node/service/src/overseer.rs | 8 +-
.../src/lib/approval/helpers.rs | 2 +-
.../src/lib/approval/message_generator.rs | 7 +-
.../src/lib/approval/mock_chain_selection.rs | 2 +-
.../subsystem-bench/src/lib/approval/mod.rs | 14 +-
polkadot/node/subsystem-types/src/messages.rs | 79 +-
.../node/approval/approval-distribution.md | 36 +-
.../src/node/approval/approval-voting.md | 40 +-
.../src/types/overseer-protocol.md | 24 +-
prdoc/pr_4928.prdoc | 28 +
27 files changed, 4648 insertions(+), 3535 deletions(-)
create mode 100644 polkadot/node/primitives/src/approval/criteria.rs
rename polkadot/node/primitives/src/{approval.rs => approval/mod.rs} (98%)
rename polkadot/node/{core/approval-voting/src => primitives/src/approval}/time.rs (95%)
create mode 100644 prdoc/pr_4928.prdoc
diff --git a/Cargo.lock b/Cargo.lock
index 4cb69d1a178..9d8f4cef142 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12989,7 +12989,9 @@ dependencies = [
"rand",
"rand_chacha",
"rand_core",
+ "sc-keystore",
"schnorrkel 0.11.4",
+ "sp-application-crypto",
"sp-authority-discovery",
"sp-core",
"sp-tracing 16.0.0",
@@ -13802,14 +13804,17 @@ dependencies = [
"bitvec",
"bounded-vec",
"futures",
+ "futures-timer",
"parity-scale-codec",
"polkadot-erasure-coding",
"polkadot-parachain-primitives",
"polkadot-primitives",
+ "sc-keystore",
"schnorrkel 0.11.4",
"serde",
"sp-application-crypto",
"sp-consensus-babe",
+ "sp-consensus-slots",
"sp-core",
"sp-keystore",
"sp-maybe-compressed-blob",
diff --git a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs
index 41418bcc511..0b03f1127ee 100644
--- a/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs
+++ b/polkadot/node/core/approval-voting/benches/approval-voting-regression-bench.rs
@@ -82,8 +82,8 @@ fn main() -> Result<(), String> {
("Sent to peers", 63995.2200, 0.01),
]));
messages.extend(average_usage.check_cpu_usage(&[
- ("approval-distribution", 6.3912, 0.1),
- ("approval-voting", 10.0578, 0.1),
+ ("approval-distribution", 12.2736, 0.1),
+ ("approval-voting", 2.7174, 0.1),
]));
if messages.is_empty() {
diff --git a/polkadot/node/core/approval-voting/src/approval_checking.rs b/polkadot/node/core/approval-voting/src/approval_checking.rs
index 96eb25626de..3774edc6998 100644
--- a/polkadot/node/core/approval-voting/src/approval_checking.rs
+++ b/polkadot/node/core/approval-voting/src/approval_checking.rs
@@ -22,9 +22,9 @@ use polkadot_primitives::ValidatorIndex;
use crate::{
persisted_entries::{ApprovalEntry, CandidateEntry, TrancheEntry},
- time::Tick,
MAX_RECORDED_NO_SHOW_VALIDATORS_PER_CANDIDATE,
};
+use polkadot_node_primitives::approval::time::Tick;
/// Result of counting the necessary tranches needed for approving a block.
#[derive(Debug, PartialEq, Clone)]
@@ -1195,9 +1195,9 @@ mod tests {
struct NoShowTest {
assignments: Vec<(ValidatorIndex, Tick)>,
approvals: Vec,
- clock_drift: crate::time::Tick,
- no_show_duration: crate::time::Tick,
- drifted_tick_now: crate::time::Tick,
+ clock_drift: Tick,
+ no_show_duration: Tick,
+ drifted_tick_now: Tick,
exp_no_shows: usize,
exp_next_no_show: Option,
}
diff --git a/polkadot/node/core/approval-voting/src/criteria.rs b/polkadot/node/core/approval-voting/src/criteria.rs
index fb9d281e43b..669b6001538 100644
--- a/polkadot/node/core/approval-voting/src/criteria.rs
+++ b/polkadot/node/core/approval-voting/src/criteria.rs
@@ -16,8 +16,11 @@
//! Assignment criteria VRF generation and checking.
-use codec::{Decode, Encode};
+use codec::Encode;
use itertools::Itertools;
+pub use polkadot_node_primitives::approval::criteria::{
+ AssignmentCriteria, Config, InvalidAssignment, InvalidAssignmentReason, OurAssignment,
+};
use polkadot_node_primitives::approval::{
self as approval_types,
v1::{AssignmentCert, AssignmentCertKind, DelayTranche, RelayVRFStory},
@@ -25,9 +28,9 @@ use polkadot_node_primitives::approval::{
AssignmentCertKindV2, AssignmentCertV2, CoreBitfield, VrfPreOutput, VrfProof, VrfSignature,
},
};
+
use polkadot_primitives::{
- AssignmentId, AssignmentPair, CandidateHash, CoreIndex, GroupIndex, IndexedVec, SessionInfo,
- ValidatorIndex,
+ AssignmentPair, CandidateHash, CoreIndex, GroupIndex, IndexedVec, ValidatorIndex,
};
use rand::{seq::SliceRandom, SeedableRng};
use rand_chacha::ChaCha20Rng;
@@ -44,56 +47,19 @@ use std::{
use super::LOG_TARGET;
-/// Details pertaining to our assignment on a block.
-#[derive(Debug, Clone, Encode, Decode, PartialEq)]
-pub struct OurAssignment {
- cert: AssignmentCertV2,
- tranche: DelayTranche,
- validator_index: ValidatorIndex,
- // Whether the assignment has been triggered already.
- triggered: bool,
-}
-
-impl OurAssignment {
- pub fn cert(&self) -> &AssignmentCertV2 {
- &self.cert
- }
-
- pub fn tranche(&self) -> DelayTranche {
- self.tranche
- }
-
- pub(crate) fn validator_index(&self) -> ValidatorIndex {
- self.validator_index
- }
-
- pub(crate) fn triggered(&self) -> bool {
- self.triggered
- }
-
- pub(crate) fn mark_triggered(&mut self) {
- self.triggered = true;
- }
-}
-
impl From for OurAssignment {
fn from(entry: crate::approval_db::v2::OurAssignment) -> Self {
- OurAssignment {
- cert: entry.cert,
- tranche: entry.tranche,
- validator_index: entry.validator_index,
- triggered: entry.triggered,
- }
+ OurAssignment::new(entry.cert, entry.tranche, entry.validator_index, entry.triggered)
}
}
impl From for crate::approval_db::v2::OurAssignment {
fn from(entry: OurAssignment) -> Self {
Self {
- cert: entry.cert,
- tranche: entry.tranche,
- validator_index: entry.validator_index,
- triggered: entry.triggered,
+ tranche: entry.tranche(),
+ validator_index: entry.validator_index(),
+ triggered: entry.triggered(),
+ cert: entry.into_cert(),
}
}
}
@@ -223,60 +189,7 @@ fn assigned_core_transcript(core_index: CoreIndex) -> Transcript {
t
}
-/// Information about the world assignments are being produced in.
-#[derive(Clone, Debug)]
-pub struct Config {
- /// The assignment public keys for validators.
- assignment_keys: Vec,
- /// The groups of validators assigned to each core.
- validator_groups: IndexedVec>,
- /// The number of availability cores used by the protocol during this session.
- n_cores: u32,
- /// The zeroth delay tranche width.
- zeroth_delay_tranche_width: u32,
- /// The number of samples we do of `relay_vrf_modulo`.
- relay_vrf_modulo_samples: u32,
- /// The number of delay tranches in total.
- n_delay_tranches: u32,
-}
-
-impl<'a> From<&'a SessionInfo> for Config {
- fn from(s: &'a SessionInfo) -> Self {
- Config {
- assignment_keys: s.assignment_keys.clone(),
- validator_groups: s.validator_groups.clone(),
- n_cores: s.n_cores,
- zeroth_delay_tranche_width: s.zeroth_delay_tranche_width,
- relay_vrf_modulo_samples: s.relay_vrf_modulo_samples,
- n_delay_tranches: s.n_delay_tranches,
- }
- }
-}
-
-/// A trait for producing and checking assignments. Used to mock.
-pub(crate) trait AssignmentCriteria {
- fn compute_assignments(
- &self,
- keystore: &LocalKeystore,
- relay_vrf_story: RelayVRFStory,
- config: &Config,
- leaving_cores: Vec<(CandidateHash, CoreIndex, GroupIndex)>,
- enable_v2_assignments: bool,
- ) -> HashMap;
-
- fn check_assignment_cert(
- &self,
- claimed_core_bitfield: CoreBitfield,
- validator_index: ValidatorIndex,
- config: &Config,
- relay_vrf_story: RelayVRFStory,
- assignment: &AssignmentCertV2,
- // Backing groups for each "leaving core".
- backing_groups: Vec,
- ) -> Result;
-}
-
-pub(crate) struct RealAssignmentCriteria;
+pub struct RealAssignmentCriteria;
impl AssignmentCriteria for RealAssignmentCriteria {
fn compute_assignments(
@@ -469,12 +382,12 @@ fn compute_relay_vrf_modulo_assignments_v1(
};
// All assignments of type RelayVRFModulo have tranche 0.
- assignments.entry(core).or_insert(OurAssignment {
- cert: cert.into(),
- tranche: 0,
+ assignments.entry(core).or_insert(OurAssignment::new(
+ cert.into(),
+ 0,
validator_index,
- triggered: false,
- });
+ false,
+ ));
}
}
}
@@ -549,7 +462,7 @@ fn compute_relay_vrf_modulo_assignments_v2(
};
// All assignments of type RelayVRFModulo have tranche 0.
- OurAssignment { cert, tranche: 0, validator_index, triggered: false }
+ OurAssignment::new(cert, 0, validator_index, false)
}) {
for core_index in assigned_cores {
assignments.insert(core_index, assignment.clone());
@@ -583,7 +496,7 @@ fn compute_relay_vrf_delay_assignments(
},
};
- let our_assignment = OurAssignment { cert, tranche, validator_index, triggered: false };
+ let our_assignment = OurAssignment::new(cert, tranche, validator_index, false);
let used = match assignments.entry(core) {
Entry::Vacant(e) => {
@@ -591,7 +504,7 @@ fn compute_relay_vrf_delay_assignments(
true
},
Entry::Occupied(mut e) =>
- if e.get().tranche > our_assignment.tranche {
+ if e.get().tranche() > our_assignment.tranche() {
e.insert(our_assignment);
true
} else {
@@ -612,35 +525,6 @@ fn compute_relay_vrf_delay_assignments(
}
}
-/// Assignment invalid.
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub struct InvalidAssignment(pub(crate) InvalidAssignmentReason);
-
-impl std::fmt::Display for InvalidAssignment {
- fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
- write!(f, "Invalid Assignment: {:?}", self.0)
- }
-}
-
-impl std::error::Error for InvalidAssignment {}
-
-/// Failure conditions when checking an assignment cert.
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub(crate) enum InvalidAssignmentReason {
- ValidatorIndexOutOfBounds,
- SampleOutOfBounds,
- CoreIndexOutOfBounds,
- InvalidAssignmentKey,
- IsInBackingGroup,
- VRFModuloCoreIndexMismatch,
- VRFModuloOutputMismatch,
- VRFDelayCoreIndexMismatch,
- VRFDelayOutputMismatch,
- InvalidArguments,
- /// Assignment vrf check resulted in 0 assigned cores.
- NullAssignment,
-}
-
/// Checks the crypto of an assignment cert. Failure conditions:
/// * Validator index out of bounds
/// * VRF signature check fails
@@ -820,13 +704,13 @@ fn is_in_backing_group(
/// Migration helpers.
impl From for OurAssignment {
fn from(value: crate::approval_db::v1::OurAssignment) -> Self {
- Self {
- cert: value.cert.into(),
- tranche: value.tranche,
- validator_index: value.validator_index,
+ Self::new(
+ value.cert.into(),
+ value.tranche,
+ value.validator_index,
// Whether the assignment has been triggered already.
- triggered: value.triggered,
- }
+ value.triggered,
+ )
}
}
@@ -834,7 +718,7 @@ impl From for OurAssignment {
mod tests {
use super::*;
use crate::import::tests::garbage_vrf_signature;
- use polkadot_primitives::{Hash, ASSIGNMENT_KEY_TYPE_ID};
+ use polkadot_primitives::{AssignmentId, Hash, ASSIGNMENT_KEY_TYPE_ID};
use sp_application_crypto::sr25519;
use sp_core::crypto::Pair as PairT;
use sp_keyring::sr25519::Keyring as Sr25519Keyring;
@@ -1053,7 +937,7 @@ mod tests {
let mut counted = 0;
for (core, assignment) in assignments {
- let cores = match assignment.cert.kind.clone() {
+ let cores = match assignment.cert().kind.clone() {
AssignmentCertKindV2::RelayVRFModuloCompact { core_bitfield } => core_bitfield,
AssignmentCertKindV2::RelayVRFModulo { sample: _ } => core.into(),
AssignmentCertKindV2::RelayVRFDelay { core_index } => core_index.into(),
@@ -1062,7 +946,7 @@ mod tests {
let mut mutated = MutatedAssignment {
cores: cores.clone(),
groups: cores.iter_ones().map(|core| group_for_core(core)).collect(),
- cert: assignment.cert,
+ cert: assignment.into_cert(),
own_group: GroupIndex(0),
val_index: ValidatorIndex(0),
config: config.clone(),
diff --git a/polkadot/node/core/approval-voting/src/import.rs b/polkadot/node/core/approval-voting/src/import.rs
index 3ddef1e01c4..b163d718eb2 100644
--- a/polkadot/node/core/approval-voting/src/import.rs
+++ b/polkadot/node/core/approval-voting/src/import.rs
@@ -62,9 +62,10 @@ use crate::{
criteria::{AssignmentCriteria, OurAssignment},
get_extended_session_info, get_session_info,
persisted_entries::CandidateEntry,
- time::{slot_number_to_tick, Tick},
};
+use polkadot_node_primitives::approval::time::{slot_number_to_tick, Tick};
+
use super::{State, LOG_TARGET};
#[derive(Debug)]
@@ -574,9 +575,13 @@ pub(crate) async fn handle_new_head(
hash: block_hash,
number: block_header.number,
parent_hash: block_header.parent_hash,
- candidates: included_candidates.iter().map(|(hash, _, _, _)| *hash).collect(),
+ candidates: included_candidates
+ .iter()
+ .map(|(hash, _, core_index, group_index)| (*hash, *core_index, *group_index))
+ .collect(),
slot,
session: session_index,
+ vrf_story: relay_vrf_story,
});
imported_candidates.push(BlockImportedCandidates {
@@ -609,6 +614,7 @@ pub(crate) mod tests {
approval_db::common::{load_block_entry, DbBackend},
RuntimeInfo, RuntimeInfoConfig, MAX_BLOCKS_WITH_ASSIGNMENT_TIMESTAMPS,
};
+ use approval_types::time::Clock;
use assert_matches::assert_matches;
use polkadot_node_primitives::{
approval::v1::{VrfSignature, VrfTranscript},
@@ -642,7 +648,7 @@ pub(crate) mod tests {
#[derive(Default)]
struct MockClock;
- impl crate::time::Clock for MockClock {
+ impl Clock for MockClock {
fn tick_now(&self) -> Tick {
42 // chosen by fair dice roll
}
diff --git a/polkadot/node/core/approval-voting/src/lib.rs b/polkadot/node/core/approval-voting/src/lib.rs
index d4b6855a44d..942922cba6d 100644
--- a/polkadot/node/core/approval-voting/src/lib.rs
+++ b/polkadot/node/core/approval-voting/src/lib.rs
@@ -40,8 +40,9 @@ use polkadot_node_subsystem::{
ApprovalCheckError, ApprovalCheckResult, ApprovalDistributionMessage,
ApprovalVotingMessage, AssignmentCheckError, AssignmentCheckResult,
AvailabilityRecoveryMessage, BlockDescription, CandidateValidationMessage, ChainApiMessage,
- ChainSelectionMessage, DisputeCoordinatorMessage, HighestApprovedAncestorBlock,
- RuntimeApiMessage, RuntimeApiRequest,
+ ChainSelectionMessage, CheckedIndirectAssignment, CheckedIndirectSignedApprovalVote,
+ DisputeCoordinatorMessage, HighestApprovedAncestorBlock, RuntimeApiMessage,
+ RuntimeApiRequest,
},
overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
SubsystemSender,
@@ -55,9 +56,8 @@ use polkadot_node_subsystem_util::{
};
use polkadot_primitives::{
ApprovalVoteMultipleCandidates, ApprovalVotingParams, BlockNumber, CandidateHash,
- CandidateIndex, CandidateReceipt, CoreIndex, DisputeStatement, ExecutorParams, GroupIndex,
- Hash, PvfExecKind, SessionIndex, SessionInfo, ValidDisputeStatementKind, ValidatorId,
- ValidatorIndex, ValidatorPair, ValidatorSignature,
+ CandidateIndex, CandidateReceipt, CoreIndex, ExecutorParams, GroupIndex, Hash, PvfExecKind,
+ SessionIndex, SessionInfo, ValidatorId, ValidatorIndex, ValidatorPair, ValidatorSignature,
};
use sc_keystore::LocalKeystore;
use sp_application_crypto::Pair;
@@ -91,9 +91,11 @@ use schnellru::{ByLength, LruMap};
use approval_checking::RequiredTranches;
use bitvec::{order::Lsb0, vec::BitVec};
-use criteria::{AssignmentCriteria, RealAssignmentCriteria};
+pub use criteria::{AssignmentCriteria, Config as AssignmentConfig, RealAssignmentCriteria};
use persisted_entries::{ApprovalEntry, BlockEntry, CandidateEntry};
-use time::{slot_number_to_tick, Clock, ClockExt, DelayedApprovalTimer, SystemClock, Tick};
+use polkadot_node_primitives::approval::time::{
+ slot_number_to_tick, Clock, ClockExt, DelayedApprovalTimer, SystemClock, Tick,
+};
mod approval_checking;
pub mod approval_db;
@@ -102,7 +104,6 @@ pub mod criteria;
mod import;
mod ops;
mod persisted_entries;
-pub mod time;
use crate::{
approval_checking::{Check, TranchesToApproveResult},
@@ -123,7 +124,6 @@ const APPROVAL_CHECKING_TIMEOUT: Duration = Duration::from_secs(120);
const WAIT_FOR_SIGS_TIMEOUT: Duration = Duration::from_millis(500);
const APPROVAL_CACHE_SIZE: u32 = 1024;
-const TICK_TOO_FAR_IN_FUTURE: Tick = 20; // 10 seconds.
const APPROVAL_DELAY: Tick = 2;
pub(crate) const LOG_TARGET: &str = "parachain::approval-voting";
@@ -1607,9 +1607,30 @@ async fn distribution_messages_for_activation(
hash: block_hash,
number: block_entry.block_number(),
parent_hash: block_entry.parent_hash(),
- candidates: block_entry.candidates().iter().map(|(_, c_hash)| *c_hash).collect(),
+ candidates: block_entry
+ .candidates()
+ .iter()
+ .map(|(core_index, c_hash)| {
+ let candidate = db.load_candidate_entry(c_hash).ok().flatten();
+ let group_index = candidate
+ .and_then(|entry| {
+ entry.approval_entry(&block_hash).map(|entry| entry.backing_group())
+ })
+ .unwrap_or_else(|| {
+ gum::warn!(
+ target: LOG_TARGET,
+ ?block_hash,
+ ?c_hash,
+ "Missing candidate entry or approval entry",
+ );
+ GroupIndex::default()
+ });
+ (*c_hash, *core_index, group_index)
+ })
+ .collect(),
slot: block_entry.slot(),
session: block_entry.session(),
+ vrf_story: block_entry.relay_vrf_story(),
});
let mut signatures_queued = HashSet::new();
for (core_index, candidate_hash) in block_entry.candidates() {
@@ -1872,35 +1893,45 @@ async fn handle_from_overseer(
vec![Action::Conclude]
},
FromOrchestra::Communication { msg } => match msg {
- ApprovalVotingMessage::CheckAndImportAssignment(a, claimed_cores, res) => {
- let (check_outcome, actions) = check_and_import_assignment(
+ ApprovalVotingMessage::ImportAssignment(checked_assignment, tx) => {
+ let (check_outcome, actions) = import_assignment(
ctx.sender(),
state,
db,
session_info_provider,
- a,
- claimed_cores,
+ checked_assignment,
)
.await?;
- let _ = res.send(check_outcome);
-
+ // approval-distribution makes sure this assignment is valid and expected,
+ // so this import should never fail, if it does it might mean one of two things,
+ // there is a bug in the code or the two subsystems got out of sync.
+ if let AssignmentCheckResult::Bad(ref err) = check_outcome {
+ gum::debug!(target: LOG_TARGET, ?err, "Unexpected fail when importing an assignment");
+ }
+ let _ = tx.map(|tx| tx.send(check_outcome));
actions
},
- ApprovalVotingMessage::CheckAndImportApproval(a, res) =>
- check_and_import_approval(
+ ApprovalVotingMessage::ImportApproval(a, tx) => {
+ let result = import_approval(
ctx.sender(),
state,
db,
session_info_provider,
metrics,
a,
- |r| {
- let _ = res.send(r);
- },
&wakeups,
)
- .await?
- .0,
+ .await?;
+ // approval-distribution makes sure this vote is valid and expected,
+ // so this import should never fail, if it does it might mean one of two things,
+ // there is a bug in the code or the two subsystems got out of sync.
+ if let ApprovalCheckResult::Bad(ref err) = result.1 {
+ gum::debug!(target: LOG_TARGET, ?err, "Unexpected fail when importing an approval");
+ }
+ let _ = tx.map(|tx| tx.send(result.1));
+
+ result.0
+ },
ApprovalVotingMessage::ApprovedAncestor(target, lower_bound, res) => {
let mut approved_ancestor_span = state
.spans
@@ -2439,29 +2470,30 @@ fn schedule_wakeup_action(
maybe_action
}
-async fn check_and_import_assignment(
+async fn import_assignment(
sender: &mut Sender,
state: &State,
db: &mut OverlayedBackend<'_, impl Backend>,
session_info_provider: &mut RuntimeInfo,
- assignment: IndirectAssignmentCertV2,
- candidate_indices: CandidateBitfield,
+ checked_assignment: CheckedIndirectAssignment,
) -> SubsystemResult<(AssignmentCheckResult, Vec)>
where
Sender: SubsystemSender,
{
let tick_now = state.clock.tick_now();
-
- let mut check_and_import_assignment_span = state
+ let assignment = checked_assignment.assignment();
+ let candidate_indices = checked_assignment.candidate_indices();
+ let tranche = checked_assignment.tranche();
+ let mut import_assignment_span = state
.spans
.get(&assignment.block_hash)
- .map(|span| span.child("check-and-import-assignment"))
- .unwrap_or_else(|| jaeger::Span::new(assignment.block_hash, "check-and-import-assignment"))
+ .map(|span| span.child("import-assignment"))
+ .unwrap_or_else(|| jaeger::Span::new(assignment.block_hash, "import-assignment"))
.with_relay_parent(assignment.block_hash)
.with_stage(jaeger::Stage::ApprovalChecking);
for candidate_index in candidate_indices.iter_ones() {
- check_and_import_assignment_span.add_uint_tag("candidate-index", candidate_index as u64);
+ import_assignment_span.add_uint_tag("candidate-index", candidate_index as u64);
}
let block_entry = match db.load_block_entry(&assignment.block_hash)? {
@@ -2514,8 +2546,6 @@ where
))
}
- // The Compact VRF modulo assignment cert has multiple core assignments.
- let mut backing_groups = Vec::new();
let mut claimed_core_indices = Vec::new();
let mut assigned_candidate_hashes = Vec::new();
@@ -2544,26 +2574,23 @@ where
)), // no candidate at core.
};
- check_and_import_assignment_span
+ import_assignment_span
.add_string_tag("candidate-hash", format!("{:?}", assigned_candidate_hash));
- check_and_import_assignment_span.add_string_tag(
+ import_assignment_span.add_string_tag(
"traceID",
format!("{:?}", jaeger::hash_to_trace_identifier(assigned_candidate_hash.0)),
);
- let approval_entry = match candidate_entry.approval_entry_mut(&assignment.block_hash) {
- Some(a) => a,
- None =>
- return Ok((
- AssignmentCheckResult::Bad(AssignmentCheckError::Internal(
- assignment.block_hash,
- assigned_candidate_hash,
- )),
- Vec::new(),
+ if candidate_entry.approval_entry_mut(&assignment.block_hash).is_none() {
+ return Ok((
+ AssignmentCheckResult::Bad(AssignmentCheckError::Internal(
+ assignment.block_hash,
+ assigned_candidate_hash,
)),
+ Vec::new(),
+ ));
};
- backing_groups.push(approval_entry.backing_group());
claimed_core_indices.push(claimed_core_index);
assigned_candidate_hashes.push(assigned_candidate_hash);
}
@@ -2579,42 +2606,6 @@ where
))
}
- // Check the assignment certificate.
- let res = state.assignment_criteria.check_assignment_cert(
- claimed_core_indices
- .clone()
- .try_into()
- .expect("Checked for null assignment above; qed"),
- assignment.validator,
- &criteria::Config::from(session_info),
- block_entry.relay_vrf_story(),
- &assignment.cert,
- backing_groups,
- );
-
- let tranche = match res {
- Err(crate::criteria::InvalidAssignment(reason)) =>
- return Ok((
- AssignmentCheckResult::Bad(AssignmentCheckError::InvalidCert(
- assignment.validator,
- format!("{:?}", reason),
- )),
- Vec::new(),
- )),
- Ok(tranche) => {
- let current_tranche =
- state.clock.tranche_now(state.slot_duration_millis, block_entry.slot());
-
- let too_far_in_future = current_tranche + TICK_TOO_FAR_IN_FUTURE as DelayTranche;
-
- if tranche >= too_far_in_future {
- return Ok((AssignmentCheckResult::TooFarInFuture, Vec::new()))
- }
-
- tranche
- },
- };
-
let mut actions = Vec::new();
let res = {
let mut is_duplicate = true;
@@ -2647,7 +2638,7 @@ where
};
is_duplicate &= approval_entry.is_assigned(assignment.validator);
approval_entry.import_assignment(tranche, assignment.validator, tick_now);
- check_and_import_assignment_span.add_uint_tag("tranche", tranche as u64);
+ import_assignment_span.add_uint_tag("tranche", tranche as u64);
// We've imported a new assignment, so we need to schedule a wake-up for when that might
// no-show.
@@ -2704,30 +2695,28 @@ where
Ok((res, actions))
}
-async fn check_and_import_approval(
+async fn import_approval(
sender: &mut Sender,
state: &mut State,
db: &mut OverlayedBackend<'_, impl Backend>,
session_info_provider: &mut RuntimeInfo,
metrics: &Metrics,
- approval: IndirectSignedApprovalVoteV2,
- with_response: impl FnOnce(ApprovalCheckResult) -> T,
+ approval: CheckedIndirectSignedApprovalVote,
wakeups: &Wakeups,
-) -> SubsystemResult<(Vec, T)>
+) -> SubsystemResult<(Vec, ApprovalCheckResult)>
where
Sender: SubsystemSender,
{
macro_rules! respond_early {
($e: expr) => {{
- let t = with_response($e);
- return Ok((Vec::new(), t))
+ return Ok((Vec::new(), $e))
}};
}
let mut span = state
.spans
.get(&approval.block_hash)
- .map(|span| span.child("check-and-import-approval"))
- .unwrap_or_else(|| jaeger::Span::new(approval.block_hash, "check-and-import-approval"))
+ .map(|span| span.child("import-approval"))
+ .unwrap_or_else(|| jaeger::Span::new(approval.block_hash, "import-approval"))
.with_string_fmt_debug_tag("candidate-index", approval.candidate_indices.clone())
.with_relay_parent(approval.block_hash)
.with_stage(jaeger::Stage::ApprovalChecking);
@@ -2774,67 +2763,11 @@ where
),
);
- {
- let session_info = match get_session_info(
- session_info_provider,
- sender,
- approval.block_hash,
- block_entry.session(),
- )
- .await
- {
- Some(s) => s,
- None => {
- respond_early!(ApprovalCheckResult::Bad(ApprovalCheckError::UnknownSessionIndex(
- block_entry.session()
- ),))
- },
- };
-
- let pubkey = match session_info.validators.get(approval.validator) {
- Some(k) => k,
- None => respond_early!(ApprovalCheckResult::Bad(
- ApprovalCheckError::InvalidValidatorIndex(approval.validator),
- )),
- };
-
- gum::trace!(
- target: LOG_TARGET,
- "Received approval for num_candidates {:}",
- approval.candidate_indices.count_ones()
- );
-
- let candidate_hashes: Vec =
- approved_candidates_info.iter().map(|candidate| candidate.1).collect();
- // Signature check:
- match DisputeStatement::Valid(
- ValidDisputeStatementKind::ApprovalCheckingMultipleCandidates(candidate_hashes.clone()),
- )
- .check_signature(
- &pubkey,
- if let Some(candidate_hash) = candidate_hashes.first() {
- *candidate_hash
- } else {
- respond_early!(ApprovalCheckResult::Bad(ApprovalCheckError::InvalidValidatorIndex(
- approval.validator
- ),))
- },
- block_entry.session(),
- &approval.signature,
- ) {
- Err(_) => {
- gum::error!(
- target: LOG_TARGET,
- "Error while checking signature {:}",
- approval.candidate_indices.count_ones()
- );
- respond_early!(ApprovalCheckResult::Bad(ApprovalCheckError::InvalidSignature(
- approval.validator
- ),))
- },
- Ok(()) => {},
- };
- }
+ gum::trace!(
+ target: LOG_TARGET,
+ "Received approval for num_candidates {:}",
+ approval.candidate_indices.count_ones()
+ );
let mut actions = Vec::new();
for (approval_candidate_index, approved_candidate_hash) in approved_candidates_info {
@@ -2898,9 +2831,7 @@ where
}
// importing the approval can be heavy as it may trigger acceptance for a series of blocks.
- let t = with_response(ApprovalCheckResult::Accepted);
-
- Ok((actions, t))
+ Ok((actions, ApprovalCheckResult::Accepted))
}
#[derive(Debug)]
diff --git a/polkadot/node/core/approval-voting/src/persisted_entries.rs b/polkadot/node/core/approval-voting/src/persisted_entries.rs
index 59a46181005..16e231aa1a2 100644
--- a/polkadot/node/core/approval-voting/src/persisted_entries.rs
+++ b/polkadot/node/core/approval-voting/src/persisted_entries.rs
@@ -36,7 +36,9 @@ use std::collections::BTreeMap;
use crate::approval_db::v2::Bitfield;
-use super::{criteria::OurAssignment, time::Tick};
+use super::criteria::OurAssignment;
+
+use polkadot_node_primitives::approval::time::Tick;
/// Metadata regarding a specific tranche of assignments for a specific candidate.
#[derive(Debug, Clone, PartialEq)]
diff --git a/polkadot/node/core/approval-voting/src/tests.rs b/polkadot/node/core/approval-voting/src/tests.rs
index b912449baa4..7126f209a94 100644
--- a/polkadot/node/core/approval-voting/src/tests.rs
+++ b/polkadot/node/core/approval-voting/src/tests.rs
@@ -41,8 +41,9 @@ use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_node_subsystem_util::TimeoutExt;
use polkadot_overseer::HeadSupportsParachains;
use polkadot_primitives::{
- ApprovalVote, CandidateCommitments, CandidateEvent, CoreIndex, GroupIndex, Header,
- Id as ParaId, IndexedVec, NodeFeatures, ValidationCode, ValidatorSignature,
+ ApprovalVote, CandidateCommitments, CandidateEvent, CoreIndex, DisputeStatement, GroupIndex,
+ Header, Id as ParaId, IndexedVec, NodeFeatures, ValidDisputeStatementKind, ValidationCode,
+ ValidatorSignature,
};
use std::{cmp::max, time::Duration};
@@ -139,8 +140,8 @@ impl HeadSupportsParachains for MockSupportsParachains {
}
}
-fn slot_to_tick(t: impl Into) -> crate::time::Tick {
- crate::time::slot_number_to_tick(SLOT_DURATION_MILLIS, t.into())
+fn slot_to_tick(t: impl Into) -> Tick {
+ slot_number_to_tick(SLOT_DURATION_MILLIS, t.into())
}
#[derive(Default, Clone)]
@@ -647,7 +648,7 @@ fn make_candidate(para_id: ParaId, hash: &Hash) -> CandidateReceipt {
r
}
-async fn check_and_import_approval(
+async fn import_approval(
overseer: &mut VirtualOverseer,
block_hash: Hash,
candidate_index: CandidateIndex,
@@ -666,14 +667,14 @@ async fn check_and_import_approval(
overseer_send(
overseer,
FromOrchestra::Communication {
- msg: ApprovalVotingMessage::CheckAndImportApproval(
- IndirectSignedApprovalVoteV2 {
+ msg: ApprovalVotingMessage::ImportApproval(
+ CheckedIndirectSignedApprovalVote::from_checked(IndirectSignedApprovalVoteV2 {
block_hash,
candidate_indices: candidate_index.into(),
validator,
signature,
- },
- tx,
+ }),
+ Some(tx),
),
},
)
@@ -689,25 +690,31 @@ async fn check_and_import_approval(
rx
}
-async fn check_and_import_assignment(
+async fn import_assignment(
overseer: &mut VirtualOverseer,
block_hash: Hash,
candidate_index: CandidateIndex,
validator: ValidatorIndex,
+ tranche: DelayTranche,
) -> oneshot::Receiver {
let (tx, rx) = oneshot::channel();
overseer_send(
overseer,
FromOrchestra::Communication {
- msg: ApprovalVotingMessage::CheckAndImportAssignment(
- IndirectAssignmentCertV2 {
- block_hash,
- validator,
- cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo { sample: 0 })
+ msg: ApprovalVotingMessage::ImportAssignment(
+ CheckedIndirectAssignment::from_checked(
+ IndirectAssignmentCertV2 {
+ block_hash,
+ validator,
+ cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
+ sample: 0,
+ })
.into(),
- },
- candidate_index.into(),
- tx,
+ },
+ candidate_index.into(),
+ tranche,
+ ),
+ Some(tx),
),
},
)
@@ -715,7 +722,7 @@ async fn check_and_import_assignment(
rx
}
-async fn check_and_import_assignment_v2(
+async fn import_assignment_v2(
overseer: &mut VirtualOverseer,
block_hash: Hash,
core_indices: Vec,
@@ -725,22 +732,27 @@ async fn check_and_import_assignment_v2(
overseer_send(
overseer,
FromOrchestra::Communication {
- msg: ApprovalVotingMessage::CheckAndImportAssignment(
- IndirectAssignmentCertV2 {
- block_hash,
- validator,
- cert: garbage_assignment_cert_v2(AssignmentCertKindV2::RelayVRFModuloCompact {
- core_bitfield: core_indices
- .clone()
- .into_iter()
- .map(|c| CoreIndex(c))
- .collect::>()
- .try_into()
- .unwrap(),
- }),
- },
- core_indices.try_into().unwrap(),
- tx,
+ msg: ApprovalVotingMessage::ImportAssignment(
+ CheckedIndirectAssignment::from_checked(
+ IndirectAssignmentCertV2 {
+ block_hash,
+ validator,
+ cert: garbage_assignment_cert_v2(
+ AssignmentCertKindV2::RelayVRFModuloCompact {
+ core_bitfield: core_indices
+ .clone()
+ .into_iter()
+ .map(|c| CoreIndex(c))
+ .collect::>()
+ .try_into()
+ .unwrap(),
+ },
+ ),
+ },
+ core_indices.try_into().unwrap(),
+ 0,
+ ),
+ Some(tx),
),
},
)
@@ -1121,26 +1133,18 @@ fn subsystem_rejects_bad_assignment_ok_criteria() {
);
builder.build(&mut virtual_overseer).await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted),);
// unknown hash
let unknown_hash = Hash::repeat_byte(0x02);
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- unknown_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, unknown_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(
rx.await,
@@ -1151,59 +1155,6 @@ fn subsystem_rejects_bad_assignment_ok_criteria() {
});
}
-#[test]
-fn subsystem_rejects_bad_assignment_err_criteria() {
- let assignment_criteria = Box::new(MockAssignmentCriteria::check_only(move |_| {
- Err(criteria::InvalidAssignment(
- criteria::InvalidAssignmentReason::ValidatorIndexOutOfBounds,
- ))
- }));
- let config = HarnessConfigBuilder::default().assignment_criteria(assignment_criteria).build();
- test_harness(config, |test_harness| async move {
- let TestHarness { mut virtual_overseer, sync_oracle_handle: _sync_oracle_handle, .. } =
- test_harness;
- assert_matches!(
- overseer_recv(&mut virtual_overseer).await,
- AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber(rx)) => {
- rx.send(Ok(0)).unwrap();
- }
- );
-
- let block_hash = Hash::repeat_byte(0x01);
- let candidate_index = 0;
- let validator = ValidatorIndex(0);
-
- let head: Hash = ChainBuilder::GENESIS_HASH;
- let mut builder = ChainBuilder::new();
- let slot = Slot::from(1 as u64);
- builder.add_block(
- block_hash,
- head,
- 1,
- BlockConfig { slot, candidates: None, session_info: None, end_syncing: false },
- );
- builder.build(&mut virtual_overseer).await;
-
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
-
- assert_eq!(
- rx.await,
- Ok(AssignmentCheckResult::Bad(AssignmentCheckError::InvalidCert(
- ValidatorIndex(0),
- "ValidatorIndexOutOfBounds".to_string(),
- ))),
- );
-
- virtual_overseer
- });
-}
-
#[test]
fn blank_subsystem_act_on_bad_block() {
test_harness(HarnessConfig::default(), |test_harness| async move {
@@ -1222,17 +1173,20 @@ fn blank_subsystem_act_on_bad_block() {
overseer_send(
&mut virtual_overseer,
FromOrchestra::Communication {
- msg: ApprovalVotingMessage::CheckAndImportAssignment(
- IndirectAssignmentCertV2 {
- block_hash: bad_block_hash,
- validator: 0u32.into(),
- cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
- sample: 0,
- })
- .into(),
- },
- 0u32.into(),
- tx,
+ msg: ApprovalVotingMessage::ImportAssignment(
+ CheckedIndirectAssignment::from_checked(
+ IndirectAssignmentCertV2 {
+ block_hash: bad_block_hash,
+ validator: 0u32.into(),
+ cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
+ sample: 0,
+ })
+ .into(),
+ },
+ 0u32.into(),
+ 0,
+ ),
+ Some(tx),
),
},
)
@@ -1295,7 +1249,7 @@ fn subsystem_rejects_approval_if_no_candidate_entry() {
});
let session_index = 1;
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -1336,7 +1290,7 @@ fn subsystem_rejects_approval_if_no_block_entry() {
let candidate_hash = dummy_candidate_receipt(block_hash).hash();
let session_index = 1;
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -1401,7 +1355,7 @@ fn subsystem_rejects_approval_before_assignment() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -1424,68 +1378,6 @@ fn subsystem_rejects_approval_before_assignment() {
});
}
-#[test]
-fn subsystem_rejects_assignment_in_future() {
- let assignment_criteria =
- Box::new(MockAssignmentCriteria::check_only(|_| Ok(TICK_TOO_FAR_IN_FUTURE as _)));
- let config = HarnessConfigBuilder::default().assignment_criteria(assignment_criteria).build();
- test_harness(config, |test_harness| async move {
- let TestHarness { mut virtual_overseer, clock, sync_oracle_handle: _sync_oracle_handle } =
- test_harness;
- assert_matches!(
- overseer_recv(&mut virtual_overseer).await,
- AllMessages::ChainApi(ChainApiMessage::FinalizedBlockNumber(rx)) => {
- rx.send(Ok(0)).unwrap();
- }
- );
-
- let block_hash = Hash::repeat_byte(0x01);
- let candidate_index = 0;
- let validator = ValidatorIndex(0);
-
- // Add block hash 00.
- ChainBuilder::new()
- .add_block(
- block_hash,
- ChainBuilder::GENESIS_HASH,
- 1,
- BlockConfig {
- slot: Slot::from(0),
- candidates: None,
- session_info: None,
- end_syncing: false,
- },
- )
- .build(&mut virtual_overseer)
- .await;
-
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
-
- assert_eq!(rx.await, Ok(AssignmentCheckResult::TooFarInFuture));
-
- // Advance clock to make assignment reasonably near.
- clock.inner.lock().set_tick(9);
-
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
-
- assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
-
- virtual_overseer
- });
-}
-
#[test]
fn subsystem_accepts_duplicate_assignment() {
test_harness(HarnessConfig::default(), |test_harness| async move {
@@ -1535,7 +1427,7 @@ fn subsystem_accepts_duplicate_assignment() {
.await;
// Initial assignment.
- let rx = check_and_import_assignment_v2(
+ let rx = import_assignment_v2(
&mut virtual_overseer,
block_hash,
vec![candidate_index1, candidate_index2],
@@ -1546,19 +1438,15 @@ fn subsystem_accepts_duplicate_assignment() {
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
// Test with single assigned core.
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::AcceptedDuplicate));
// Test with multiple assigned cores. This cannot happen in practice, as tranche0
// assignments are sent first, but we should still ensure correct behavior.
- let rx = check_and_import_assignment_v2(
+ let rx = import_assignment_v2(
&mut virtual_overseer,
block_hash,
vec![candidate_index1, candidate_index2],
@@ -1604,13 +1492,9 @@ fn subsystem_rejects_assignment_with_unknown_candidate() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(
rx.await,
@@ -1654,13 +1538,9 @@ fn subsystem_rejects_oversized_bitfields() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(
rx.await,
@@ -1669,13 +1549,9 @@ fn subsystem_rejects_oversized_bitfields() {
))),
);
- let rx = check_and_import_assignment_v2(
- &mut virtual_overseer,
- block_hash,
- vec![1, 2, 10, 50],
- validator,
- )
- .await;
+ let rx =
+ import_assignment_v2(&mut virtual_overseer, block_hash, vec![1, 2, 10, 50], validator)
+ .await;
assert_eq!(
rx.await,
@@ -1727,17 +1603,13 @@ fn subsystem_accepts_and_imports_approval_after_assignment() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -1819,19 +1691,15 @@ fn subsystem_second_approval_import_only_schedules_wakeups() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
assert!(clock.inner.lock().current_wakeup_is(APPROVAL_DELAY + 2));
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -1848,7 +1716,7 @@ fn subsystem_second_approval_import_only_schedules_wakeups() {
futures_timer::Delay::new(Duration::from_millis(100)).await;
assert!(clock.inner.lock().current_wakeup_is(APPROVAL_DELAY + 2));
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -1907,13 +1775,9 @@ fn subsystem_assignment_import_updates_candidate_entry_and_schedules_wakeup() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
@@ -2029,20 +1893,17 @@ fn test_approvals_on_fork_are_always_considered_after_no_show(
.await;
// Send assignments for the same candidate on both forks
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash_fork,
candidate_index,
validator,
+ 0,
)
.await;
@@ -2072,7 +1933,7 @@ fn test_approvals_on_fork_are_always_considered_after_no_show(
futures_timer::Delay::new(Duration::from_millis(100)).await;
// Send the approval for candidate just in the context of 0x01 block.
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -2142,13 +2003,9 @@ fn subsystem_process_wakeup_schedules_wakeup() {
.build(&mut virtual_overseer)
.await;
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
@@ -2201,17 +2058,20 @@ fn linear_import_act_on_leaf() {
overseer_send(
&mut virtual_overseer,
FromOrchestra::Communication {
- msg: ApprovalVotingMessage::CheckAndImportAssignment(
- IndirectAssignmentCertV2 {
- block_hash: head,
- validator: 0u32.into(),
- cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
- sample: 0,
- })
- .into(),
- },
- 0u32.into(),
- tx,
+ msg: ApprovalVotingMessage::ImportAssignment(
+ CheckedIndirectAssignment::from_checked(
+ IndirectAssignmentCertV2 {
+ block_hash: head,
+ validator: 0u32.into(),
+ cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
+ sample: 0,
+ })
+ .into(),
+ },
+ 0u32.into(),
+ 0,
+ ),
+ Some(tx),
),
},
)
@@ -2272,17 +2132,20 @@ fn forkful_import_at_same_height_act_on_leaf() {
overseer_send(
&mut virtual_overseer,
FromOrchestra::Communication {
- msg: ApprovalVotingMessage::CheckAndImportAssignment(
- IndirectAssignmentCertV2 {
- block_hash: head,
- validator: 0u32.into(),
- cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
- sample: 0,
- })
- .into(),
- },
- 0u32.into(),
- tx,
+ msg: ApprovalVotingMessage::ImportAssignment(
+ CheckedIndirectAssignment::from_checked(
+ IndirectAssignmentCertV2 {
+ block_hash: head,
+ validator: 0u32.into(),
+ cert: garbage_assignment_cert(AssignmentCertKind::RelayVRFModulo {
+ sample: 0,
+ })
+ .into(),
+ },
+ 0u32.into(),
+ 0,
+ ),
+ Some(tx),
),
},
)
@@ -2439,21 +2302,23 @@ fn import_checked_approval_updates_entries_and_schedules() {
let candidate_index = 0;
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_a,
+ 0,
)
.await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted),);
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_b,
+ 0,
)
.await;
@@ -2462,7 +2327,7 @@ fn import_checked_approval_updates_entries_and_schedules() {
let session_index = 1;
let sig_a = sign_approval(Sr25519Keyring::Alice, candidate_hash, session_index);
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -2489,7 +2354,7 @@ fn import_checked_approval_updates_entries_and_schedules() {
clock.inner.lock().wakeup_all(2);
let sig_b = sign_approval(Sr25519Keyring::Bob, candidate_hash, session_index);
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -2602,13 +2467,9 @@ fn subsystem_import_checked_approval_sets_one_block_bit_at_a_time() {
];
for (candidate_index, validator) in assignments {
- let rx = check_and_import_assignment(
- &mut virtual_overseer,
- block_hash,
- candidate_index,
- validator,
- )
- .await;
+ let rx =
+ import_assignment(&mut virtual_overseer, block_hash, candidate_index, validator, 0)
+ .await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
}
@@ -2629,7 +2490,7 @@ fn subsystem_import_checked_approval_sets_one_block_bit_at_a_time() {
} else {
sign_approval(Sr25519Keyring::Bob, *candidate_hash, session_index)
};
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
*candidate_index,
@@ -2887,11 +2748,12 @@ fn approved_ancestor_test(
for (i, (block_hash, candidate_hash)) in
block_hashes.iter().zip(candidate_hashes).enumerate()
{
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
*block_hash,
candidate_index,
validator,
+ 0,
)
.await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
@@ -2900,7 +2762,7 @@ fn approved_ancestor_test(
continue
}
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
*block_hash,
candidate_index,
@@ -3355,7 +3217,8 @@ where
F1: 'static
+ Fn(ValidatorIndex) -> Result
+ Send
- + Sync,
+ + Sync
+ + Clone,
F2: Fn(Tick) -> bool,
{
let TriggersAssignmentConfig {
@@ -3384,7 +3247,7 @@ where
);
assignments
},
- assign_validator_tranche,
+ assign_validator_tranche.clone(),
));
let config = HarnessConfigBuilder::default().assignment_criteria(assignment_criteria).build();
let store = config.backend();
@@ -3445,11 +3308,12 @@ where
.await;
for validator in assignments_to_import {
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
ValidatorIndex(validator),
+ assign_validator_tranche(ValidatorIndex(validator)).unwrap(),
)
.await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted));
@@ -3458,7 +3322,7 @@ where
let n_validators = validators.len();
for (i, &validator_index) in approvals_to_import.iter().enumerate() {
let expect_chain_approved = 3 * (i + 1) > n_validators;
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -3763,31 +3627,34 @@ fn pre_covers_dont_stall_approval() {
let candidate_index = 0;
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_a,
+ 0,
)
.await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted),);
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_b,
+ 0,
)
.await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted),);
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_c,
+ 1,
)
.await;
@@ -3796,7 +3663,7 @@ fn pre_covers_dont_stall_approval() {
let session_index = 1;
let sig_b = sign_approval(Sr25519Keyring::Bob, candidate_hash, session_index);
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -3811,7 +3678,7 @@ fn pre_covers_dont_stall_approval() {
assert_eq!(rx.await, Ok(ApprovalCheckResult::Accepted),);
let sig_c = sign_approval(Sr25519Keyring::Charlie, candidate_hash, session_index);
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -3941,21 +3808,23 @@ fn waits_until_approving_assignments_are_old_enough() {
let candidate_index = 0;
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_a,
+ 0,
)
.await;
assert_eq!(rx.await, Ok(AssignmentCheckResult::Accepted),);
- let rx = check_and_import_assignment(
+ let rx = import_assignment(
&mut virtual_overseer,
block_hash,
candidate_index,
validator_index_b,
+ 0,
)
.await;
@@ -3966,7 +3835,7 @@ fn waits_until_approving_assignments_are_old_enough() {
let session_index = 1;
let sig_a = sign_approval(Sr25519Keyring::Alice, candidate_hash, session_index);
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -3982,7 +3851,7 @@ fn waits_until_approving_assignments_are_old_enough() {
let sig_b = sign_approval(Sr25519Keyring::Bob, candidate_hash, session_index);
- let rx = check_and_import_approval(
+ let rx = import_approval(
&mut virtual_overseer,
block_hash,
candidate_index,
@@ -4992,7 +4861,6 @@ fn subsystem_sends_pending_approvals_on_approval_restart() {
}));
}
);
-
assert_matches!(
overseer_recv(&mut virtual_overseer).await,
AllMessages::RuntimeApi(
diff --git a/polkadot/node/network/approval-distribution/Cargo.toml b/polkadot/node/network/approval-distribution/Cargo.toml
index 1bd3d51b5c9..51478dfa4a4 100644
--- a/polkadot/node/network/approval-distribution/Cargo.toml
+++ b/polkadot/node/network/approval-distribution/Cargo.toml
@@ -26,6 +26,8 @@ gum = { workspace = true, default-features = true }
bitvec = { features = ["alloc"], workspace = true }
[dev-dependencies]
+sc-keystore = { workspace = true }
+sp-application-crypto = { workspace = true, default-features = true }
sp-authority-discovery = { workspace = true, default-features = true }
sp-core = { features = ["std"], workspace = true, default-features = true }
diff --git a/polkadot/node/network/approval-distribution/src/lib.rs b/polkadot/node/network/approval-distribution/src/lib.rs
index a1bdc47e9fb..971b6de5f8f 100644
--- a/polkadot/node/network/approval-distribution/src/lib.rs
+++ b/polkadot/node/network/approval-distribution/src/lib.rs
@@ -24,7 +24,7 @@
#![warn(missing_docs)]
use self::metrics::Metrics;
-use futures::{channel::oneshot, select, FutureExt as _};
+use futures::{select, FutureExt as _};
use itertools::Itertools;
use net_protocol::peer_set::{ProtocolVersion, ValidationVersion};
use polkadot_node_jaeger as jaeger;
@@ -35,29 +35,41 @@ use polkadot_node_network_protocol::{
v1 as protocol_v1, v2 as protocol_v2, v3 as protocol_v3, PeerId,
UnifiedReputationChange as Rep, Versioned, View,
};
-use polkadot_node_primitives::approval::{
- v1::{
- AssignmentCertKind, BlockApprovalMeta, IndirectAssignmentCert, IndirectSignedApprovalVote,
- },
- v2::{
- AsBitIndex, AssignmentCertKindV2, CandidateBitfield, IndirectAssignmentCertV2,
- IndirectSignedApprovalVoteV2,
+use polkadot_node_primitives::{
+ approval::{
+ criteria::{AssignmentCriteria, InvalidAssignment},
+ time::{Clock, ClockExt, SystemClock, TICK_TOO_FAR_IN_FUTURE},
+ v1::{
+ AssignmentCertKind, BlockApprovalMeta, DelayTranche, IndirectAssignmentCert,
+ IndirectSignedApprovalVote, RelayVRFStory,
+ },
+ v2::{
+ AsBitIndex, AssignmentCertKindV2, CandidateBitfield, IndirectAssignmentCertV2,
+ IndirectSignedApprovalVoteV2,
+ },
},
+ DISPUTE_WINDOW,
};
use polkadot_node_subsystem::{
messages::{
- ApprovalCheckResult, ApprovalDistributionMessage, ApprovalVotingMessage,
- AssignmentCheckResult, NetworkBridgeEvent, NetworkBridgeTxMessage,
+ ApprovalDistributionMessage, ApprovalVotingMessage, CheckedIndirectAssignment,
+ CheckedIndirectSignedApprovalVote, NetworkBridgeEvent, NetworkBridgeTxMessage,
+ RuntimeApiMessage,
},
overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
};
-use polkadot_node_subsystem_util::reputation::{ReputationAggregator, REPUTATION_CHANGE_INTERVAL};
+use polkadot_node_subsystem_util::{
+ reputation::{ReputationAggregator, REPUTATION_CHANGE_INTERVAL},
+ runtime::{Config as RuntimeInfoConfig, ExtendedSessionInfo, RuntimeInfo},
+};
use polkadot_primitives::{
- BlockNumber, CandidateIndex, Hash, SessionIndex, ValidatorIndex, ValidatorSignature,
+ BlockNumber, CandidateHash, CandidateIndex, CoreIndex, DisputeStatement, GroupIndex, Hash,
+ SessionIndex, Slot, ValidDisputeStatementKind, ValidatorIndex, ValidatorSignature,
};
use rand::{CryptoRng, Rng, SeedableRng};
use std::{
collections::{hash_map, BTreeMap, HashMap, HashSet, VecDeque},
+ sync::Arc,
time::Duration,
};
@@ -86,6 +98,9 @@ const MAX_BITFIELD_SIZE: usize = 500;
/// The Approval Distribution subsystem.
pub struct ApprovalDistribution {
metrics: Metrics,
+ slot_duration_millis: u64,
+ clock: Box,
+ assignment_criteria: Arc,
}
/// Contains recently finalized
@@ -354,6 +369,9 @@ pub struct State {
/// Aggregated reputation change
reputation: ReputationAggregator,
+
+ /// Slot duration in millis
+ slot_duration_millis: u64,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -488,11 +506,17 @@ struct BlockEntry {
knowledge: Knowledge,
/// A votes entry for each candidate indexed by [`CandidateIndex`].
candidates: Vec,
+ /// Information about candidate metadata.
+ candidates_metadata: Vec<(CandidateHash, CoreIndex, GroupIndex)>,
/// The session index of this block.
session: SessionIndex,
/// Approval entries for whole block. These also contain all approvals in the case of multiple
/// candidates being claimed by assignments.
approval_entries: HashMap<(ValidatorIndex, CandidateBitfield), ApprovalEntry>,
+ /// The block vrf story.
+ vrf_story: RelayVRFStory,
+ /// The block slot.
+ slot: Slot,
}
impl BlockEntry {
@@ -646,6 +670,41 @@ enum MessageSource {
Local,
}
+// Encountered error while validating an assignment.
+#[derive(Debug)]
+enum InvalidAssignmentError {
+ // The vrf check for the assignment failed.
+ #[allow(dead_code)]
+ CryptoCheckFailed(InvalidAssignment),
+ // The assignment did not claim any valid candidate.
+ NoClaimedCandidates,
+ // Claimed invalid candidate.
+ #[allow(dead_code)]
+ ClaimedInvalidCandidateIndex {
+ claimed_index: usize,
+ max_index: usize,
+ },
+ // The assignment claimes more candidates than the maximum allowed.
+ OversizedClaimedBitfield,
+ // `SessionInfo` was not found for the block hash in the assignment.
+ #[allow(dead_code)]
+ SessionInfoNotFound(polkadot_node_subsystem_util::runtime::Error),
+}
+
+// Encountered error while validating an approval.
+#[derive(Debug)]
+enum InvalidVoteError {
+ // The candidate index was out of bounds.
+ CandidateIndexOutOfBounds,
+ // The validator index was out of bounds.
+ ValidatorIndexOutOfBounds,
+ // The signature of the vote was invalid.
+ InvalidSignature,
+ // `SessionInfo` was not found for the block hash in the approval.
+ #[allow(dead_code)]
+ SessionInfoNotFound(polkadot_node_subsystem_util::runtime::Error),
+}
+
impl MessageSource {
fn peer_id(&self) -> Option {
match self {
@@ -662,16 +721,26 @@ enum PendingMessage {
#[overseer::contextbounds(ApprovalDistribution, prefix = self::overseer)]
impl State {
+ /// Build State with specified slot duration.
+ pub fn with_config(slot_duration_millis: u64) -> Self {
+ Self { slot_duration_millis, ..Default::default() }
+ }
+
async fn handle_network_msg<
N: overseer::SubsystemSender,
A: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
>(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
event: NetworkBridgeEvent,
rng: &mut (impl CryptoRng + Rng),
+ assignment_criteria: &(impl AssignmentCriteria + ?Sized),
+ clock: &(impl Clock + ?Sized),
+ session_info_provider: &mut RuntimeInfo,
) {
match event {
NetworkBridgeEvent::PeerConnected(peer_id, role, version, authority_ids) => {
@@ -727,10 +796,14 @@ impl State {
self.process_incoming_peer_message(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
peer_id,
message,
rng,
+ assignment_criteria,
+ clock,
+ session_info_provider,
)
.await;
},
@@ -776,16 +849,28 @@ impl State {
async fn handle_new_blocks<
N: overseer::SubsystemSender,
A: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
>(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
metas: Vec,
rng: &mut (impl CryptoRng + Rng),
+ assignment_criteria: &(impl AssignmentCriteria + ?Sized),
+ clock: &(impl Clock + ?Sized),
+ session_info_provider: &mut RuntimeInfo,
) {
let mut new_hashes = HashSet::new();
- for meta in &metas {
+
+ gum::debug!(
+ target: LOG_TARGET,
+ "Got new blocks {:?}",
+ metas.iter().map(|m| (m.hash, m.number)).collect::>(),
+ );
+
+ for meta in metas {
let mut span = self
.spans
.get(&meta.hash)
@@ -809,6 +894,9 @@ impl State {
candidates,
session: meta.session,
approval_entries: HashMap::new(),
+ candidates_metadata: meta.candidates,
+ vrf_story: meta.vrf_story,
+ slot: meta.slot,
});
self.topologies.inc_session_refs(meta.session);
@@ -823,12 +911,6 @@ impl State {
}
}
- gum::debug!(
- target: LOG_TARGET,
- "Got new blocks {:?}",
- metas.iter().map(|m| (m.hash, m.number)).collect::>(),
- );
-
{
for (peer_id, PeerEntry { view, version }) in self.peer_views.iter() {
let intersection = view.iter().filter(|h| new_hashes.contains(h));
@@ -883,11 +965,15 @@ impl State {
self.import_and_circulate_assignment(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
MessageSource::Peer(peer_id),
assignment,
claimed_indices,
rng,
+ assignment_criteria,
+ clock,
+ session_info_provider,
)
.await;
},
@@ -895,9 +981,11 @@ impl State {
self.import_and_circulate_approval(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
MessageSource::Peer(peer_id),
approval_vote,
+ session_info_provider,
)
.await;
},
@@ -943,17 +1031,22 @@ impl State {
.await;
}
- async fn process_incoming_assignments(
+ async fn process_incoming_assignments(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
peer_id: PeerId,
assignments: Vec<(IndirectAssignmentCertV2, CandidateBitfield)>,
rng: &mut R,
+ assignment_criteria: &(impl AssignmentCriteria + ?Sized),
+ clock: &(impl Clock + ?Sized),
+ session_info_provider: &mut RuntimeInfo,
) where
A: overseer::SubsystemSender,
N: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
R: CryptoRng + Rng,
{
for (assignment, claimed_indices) in assignments {
@@ -978,11 +1071,15 @@ impl State {
self.import_and_circulate_assignment(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
MessageSource::Peer(peer_id),
assignment,
claimed_indices,
rng,
+ assignment_criteria,
+ clock,
+ session_info_provider,
)
.await;
}
@@ -992,13 +1089,16 @@ impl State {
async fn process_incoming_approvals<
N: overseer::SubsystemSender,
A: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
>(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
peer_id: PeerId,
approvals: Vec,
+ session_info_provider: &mut RuntimeInfo,
) {
gum::trace!(
target: LOG_TARGET,
@@ -1028,18 +1128,21 @@ impl State {
self.import_and_circulate_approval(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
MessageSource::Peer(peer_id),
approval_vote,
+ session_info_provider,
)
.await;
}
}
- async fn process_incoming_peer_message(
+ async fn process_incoming_peer_message(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
peer_id: PeerId,
msg: Versioned<
@@ -1048,9 +1151,13 @@ impl State {
protocol_v3::ApprovalDistributionMessage,
>,
rng: &mut R,
+ assignment_criteria: &(impl AssignmentCriteria + ?Sized),
+ clock: &(impl Clock + ?Sized),
+ session_info_provider: &mut RuntimeInfo,
) where
A: overseer::SubsystemSender,
N: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
R: CryptoRng + Rng,
{
match msg {
@@ -1067,10 +1174,14 @@ impl State {
self.process_incoming_assignments(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
peer_id,
sanitized_assignments,
rng,
+ assignment_criteria,
+ clock,
+ session_info_provider,
)
.await;
},
@@ -1089,10 +1200,14 @@ impl State {
self.process_incoming_assignments(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
peer_id,
sanitized_assignments,
rng,
+ assignment_criteria,
+ clock,
+ session_info_provider,
)
.await;
},
@@ -1102,9 +1217,11 @@ impl State {
self.process_incoming_approvals(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
peer_id,
sanitized_approvals,
+ session_info_provider,
)
.await;
},
@@ -1115,9 +1232,11 @@ impl State {
self.process_incoming_approvals(
approval_voting_sender,
network_sender,
+ runtime_api_sender,
metrics,
peer_id,
sanitized_approvals,
+ session_info_provider,
)
.await;
},
@@ -1218,18 +1337,23 @@ impl State {
self.enable_aggression(network_sender, Resend::No, metrics).await;
}
- async fn import_and_circulate_assignment(
+ async fn import_and_circulate_assignment(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
source: MessageSource,
assignment: IndirectAssignmentCertV2,
claimed_candidate_indices: CandidateBitfield,
rng: &mut R,
+ assignment_criteria: &(impl AssignmentCriteria + ?Sized),
+ clock: &(impl Clock + ?Sized),
+ session_info_provider: &mut RuntimeInfo,
) where
A: overseer::SubsystemSender,
N: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
R: CryptoRng + Rng,
{
let _span = self
@@ -1355,35 +1479,47 @@ impl State {
return
}
- let (tx, rx) = oneshot::channel();
+ let result = Self::check_assignment_valid(
+ assignment_criteria,
+ &entry,
+ &assignment,
+ &claimed_candidate_indices,
+ session_info_provider,
+ runtime_api_sender,
+ )
+ .await;
- approval_voting_sender
- .send_message(ApprovalVotingMessage::CheckAndImportAssignment(
- assignment.clone(),
- claimed_candidate_indices.clone(),
- tx,
- ))
- .await;
+ match result {
+ Ok(checked_assignment) => {
+ let current_tranche = clock.tranche_now(self.slot_duration_millis, entry.slot);
+ let too_far_in_future =
+ current_tranche + TICK_TOO_FAR_IN_FUTURE as DelayTranche;
- let timer = metrics.time_awaiting_approval_voting();
- let result = match rx.await {
- Ok(result) => result,
- Err(_) => {
- gum::debug!(target: LOG_TARGET, "The approval voting subsystem is down");
- return
- },
- };
- drop(timer);
+ if checked_assignment.tranche() >= too_far_in_future {
+ gum::debug!(
+ target: LOG_TARGET,
+ hash = ?block_hash,
+ ?peer_id,
+ "Got an assignment too far in the future",
+ );
+ modify_reputation(
+ &mut self.reputation,
+ network_sender,
+ peer_id,
+ COST_ASSIGNMENT_TOO_FAR_IN_THE_FUTURE,
+ )
+ .await;
+ metrics.on_assignment_far();
- gum::trace!(
- target: LOG_TARGET,
- ?source,
- ?message_subject,
- ?result,
- "Checked assignment",
- );
- match result {
- AssignmentCheckResult::Accepted => {
+ return
+ }
+
+ approval_voting_sender
+ .send_message(ApprovalVotingMessage::ImportAssignment(
+ checked_assignment,
+ None,
+ ))
+ .await;
modify_reputation(
&mut self.reputation,
network_sender,
@@ -1396,47 +1532,12 @@ impl State {
peer_knowledge.received.insert(message_subject.clone(), message_kind);
}
},
- AssignmentCheckResult::AcceptedDuplicate => {
- // "duplicate" assignments aren't necessarily equal.
- // There is more than one way each validator can be assigned to each core.
- // cf. https://github.com/paritytech/polkadot/pull/2160#discussion_r557628699
- if let Some(peer_knowledge) = entry.known_by.get_mut(&peer_id) {
- peer_knowledge.received.insert(message_subject.clone(), message_kind);
- }
- gum::debug!(
- target: LOG_TARGET,
- hash = ?block_hash,
- ?peer_id,
- "Got an `AcceptedDuplicate` assignment",
- );
- metrics.on_assignment_duplicatevoting();
-
- return
- },
- AssignmentCheckResult::TooFarInFuture => {
- gum::debug!(
- target: LOG_TARGET,
- hash = ?block_hash,
- ?peer_id,
- "Got an assignment too far in the future",
- );
- modify_reputation(
- &mut self.reputation,
- network_sender,
- peer_id,
- COST_ASSIGNMENT_TOO_FAR_IN_THE_FUTURE,
- )
- .await;
- metrics.on_assignment_far();
-
- return
- },
- AssignmentCheckResult::Bad(error) => {
+ Err(error) => {
gum::info!(
target: LOG_TARGET,
hash = ?block_hash,
?peer_id,
- %error,
+ ?error,
"Got a bad assignment from peer",
);
modify_reputation(
@@ -1577,6 +1678,64 @@ impl State {
}
}
+ async fn check_assignment_valid>(
+ assignment_criteria: &(impl AssignmentCriteria + ?Sized),
+ entry: &BlockEntry,
+ assignment: &IndirectAssignmentCertV2,
+ claimed_candidate_indices: &CandidateBitfield,
+ runtime_info: &mut RuntimeInfo,
+ runtime_api_sender: &mut RA,
+ ) -> Result {
+ let ExtendedSessionInfo { ref session_info, .. } = runtime_info
+ .get_session_info_by_index(runtime_api_sender, assignment.block_hash, entry.session)
+ .await
+ .map_err(|err| InvalidAssignmentError::SessionInfoNotFound(err))?;
+
+ if claimed_candidate_indices.len() > session_info.n_cores as usize {
+ return Err(InvalidAssignmentError::OversizedClaimedBitfield)
+ }
+
+ let claimed_cores: Vec = claimed_candidate_indices
+ .iter_ones()
+ .map(|candidate_index| {
+ entry.candidates_metadata.get(candidate_index).map(|(_, core, _)| *core).ok_or(
+ InvalidAssignmentError::ClaimedInvalidCandidateIndex {
+ claimed_index: candidate_index,
+ max_index: entry.candidates_metadata.len(),
+ },
+ )
+ })
+ .collect::, InvalidAssignmentError>>()?;
+
+ let Ok(claimed_cores) = claimed_cores.try_into() else {
+ return Err(InvalidAssignmentError::NoClaimedCandidates)
+ };
+
+ let backing_groups = claimed_candidate_indices
+ .iter_ones()
+ .flat_map(|candidate_index| {
+ entry.candidates_metadata.get(candidate_index).map(|(_, _, group)| *group)
+ })
+ .collect::>();
+
+ assignment_criteria
+ .check_assignment_cert(
+ claimed_cores,
+ assignment.validator,
+ &polkadot_node_primitives::approval::criteria::Config::from(session_info),
+ entry.vrf_story.clone(),
+ &assignment.cert,
+ backing_groups,
+ )
+ .map_err(|err| InvalidAssignmentError::CryptoCheckFailed(err))
+ .map(|tranche| {
+ CheckedIndirectAssignment::from_checked(
+ assignment.clone(),
+ claimed_candidate_indices.clone(),
+ tranche,
+ )
+ })
+ }
// Checks if an approval can be processed.
// Returns true if we can continue with processing the approval and false otherwise.
async fn check_approval_can_be_processed<
@@ -1666,13 +1825,16 @@ impl State {
async fn import_and_circulate_approval<
N: overseer::SubsystemSender,
A: overseer::SubsystemSender,
+ RA: overseer::SubsystemSender,
>(
&mut self,
approval_voting_sender: &mut A,
network_sender: &mut N,
+ runtime_api_sender: &mut RA,
metrics: &Metrics,
source: MessageSource,
vote: IndirectSignedApprovalVoteV2,
+ session_info_provider: &mut RuntimeInfo,
) {
let _span = self
.spans
@@ -1740,31 +1902,16 @@ impl State {
return
}
- let (tx, rx) = oneshot::channel();
-
- approval_voting_sender
- .send_message(ApprovalVotingMessage::CheckAndImportApproval(vote.clone(), tx))
- .await;
-
- let timer = metrics.time_awaiting_approval_voting();
- let result = match rx.await {
- Ok(result) => result,
- Err(_) => {
- gum::debug!(target: LOG_TARGET, "The approval voting subsystem is down");
- return
- },
- };
- drop(timer);
+ let result =
+ Self::check_vote_valid(&vote, &entry, session_info_provider, runtime_api_sender)
+ .await;
- gum::trace!(
- target: LOG_TARGET,
- ?peer_id,
- ?result,
- ?vote,
- "Checked approval",
- );
match result {
- ApprovalCheckResult::Accepted => {
+ Ok(vote) => {
+ approval_voting_sender
+ .send_message(ApprovalVotingMessage::ImportApproval(vote, None))
+ .await;
+
modify_reputation(
&mut self.reputation,
network_sender,
@@ -1782,7 +1929,7 @@ impl State {
.insert(approval_knwowledge_key.0.clone(), approval_knwowledge_key.1);
}
},
- ApprovalCheckResult::Bad(error) => {
+ Err(err) => {
modify_reputation(
&mut self.reputation,
network_sender,
@@ -1790,10 +1937,11 @@ impl State {
COST_INVALID_MESSAGE,
)
.await;
+
gum::info!(
target: LOG_TARGET,
?peer_id,
- %error,
+ ?err,
"Got a bad approval from peer",
);
metrics.on_approval_bad();
@@ -1891,6 +2039,50 @@ impl State {
}
}
+ // Checks if the approval vote is valid.
+ async fn check_vote_valid>(
+ vote: &IndirectSignedApprovalVoteV2,
+ entry: &BlockEntry,
+ runtime_info: &mut RuntimeInfo,
+ runtime_api_sender: &mut RA,
+ ) -> Result {
+ if vote.candidate_indices.len() > entry.candidates_metadata.len() {
+ return Err(InvalidVoteError::CandidateIndexOutOfBounds)
+ }
+
+ let candidate_hashes = vote
+ .candidate_indices
+ .iter_ones()
+ .flat_map(|candidate_index| {
+ entry
+ .candidates_metadata
+ .get(candidate_index)
+ .map(|(candidate_hash, _, _)| *candidate_hash)
+ })
+ .collect::>();
+
+ let ExtendedSessionInfo { ref session_info, .. } = runtime_info
+ .get_session_info_by_index(runtime_api_sender, vote.block_hash, entry.session)
+ .await
+ .map_err(|err| InvalidVoteError::SessionInfoNotFound(err))?;
+
+ let pubkey = session_info
+ .validators
+ .get(vote.validator)
+ .ok_or(InvalidVoteError::ValidatorIndexOutOfBounds)?;
+ DisputeStatement::Valid(ValidDisputeStatementKind::ApprovalCheckingMultipleCandidates(
+ candidate_hashes.clone(),
+ ))
+ .check_signature(
+ &pubkey,
+ *candidate_hashes.first().unwrap(),
+ entry.session,
+ &vote.signature,
+ )
+ .map_err(|_| InvalidVoteError::InvalidSignature)
+ .map(|_| CheckedIndirectSignedApprovalVote::from_checked(vote.clone()))
+ }
+
/// Retrieve approval signatures from state for the given relay block/indices:
fn get_approval_signatures(
&mut self,
@@ -2468,16 +2660,48 @@ async fn modify_reputation(
#[overseer::contextbounds(ApprovalDistribution, prefix = self::overseer)]
impl ApprovalDistribution {
/// Create a new instance of the [`ApprovalDistribution`] subsystem.
- pub fn new(metrics: Metrics) -> Self {
- Self { metrics }
+ pub fn new(
+ metrics: Metrics,
+ slot_duration_millis: u64,
+ assignment_criteria: Arc,
+ ) -> Self {
+ Self::new_with_clock(
+ metrics,
+ slot_duration_millis,
+ Box::new(SystemClock),
+ assignment_criteria,
+ )
+ }
+
+ /// Create a new instance of the [`ApprovalDistribution`] subsystem, with a custom clock.
+ pub fn new_with_clock(
+ metrics: Metrics,
+ slot_duration_millis: u64,
+ clock: Box,
+ assignment_criteria: Arc