2 Commits

Author SHA1 Message Date
Luke Parker
ce676efb1f cargo update 2025-01-03 07:01:06 -05:00
Luke Parker
0a611cb155 Further flesh out tributary scanning
Renames `label` to `round` since `Label` was renamed to `SigningProtocolRound`.

Adds some more context-less validation to transactions which used to be done
within the custom decode function which was simplified via the usage of borsh.

Documents in processor-messages where the Coordinator sends each of its
messages.
2025-01-03 06:57:28 -05:00
7 changed files with 488 additions and 199 deletions

271
Cargo.lock generated
View File

@@ -112,9 +112,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-consensus" name = "alloy-consensus"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "db66918860ff33920fb9e6d648d1e8cee275321406ea255ac9320f6562e26fec" checksum = "f4138dc275554afa6f18c4217262ac9388790b2fc393c2dfe03c51d357abf013"
dependencies = [ dependencies = [
"alloy-eips", "alloy-eips",
"alloy-primitives", "alloy-primitives",
@@ -130,9 +130,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-consensus-any" name = "alloy-consensus-any"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04519b5157de8a2166bddb07d84a63590100f1d3e2b3682144e787f1c27ccdac" checksum = "0fa04e1882c31288ce1028fdf31b6ea94cfa9eafa2e497f903ded631c8c6a42c"
dependencies = [ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-eips", "alloy-eips",
@@ -144,9 +144,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-core" name = "alloy-core"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c618bd382f0bc2ac26a7e4bfae01c9b015ca8f21b37ca40059ae35a7e62b3dc6" checksum = "5e3fdddfc89197319b1be19875a70ced62a72bebb67e2276dad688cd59f40e70"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
] ]
@@ -177,9 +177,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-eips" name = "alloy-eips"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e56518f46b074d562ac345238343e2231b672a13aca18142d285f95cc055980b" checksum = "52dd5869ed09e399003e0e0ec6903d981b2a92e74c5d37e6b40890bad2517526"
dependencies = [ dependencies = [
"alloy-eip2930", "alloy-eip2930",
"alloy-eip7702", "alloy-eip7702",
@@ -195,9 +195,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-genesis" name = "alloy-genesis"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cf200fd4c28435995e47b26d4761a4cf6e1011a13b81f9a9afaf16a93d9fd09" checksum = "e7d2a7fe5c1a9bd6793829ea21a636f30fc2b3f5d2e7418ba86d96e41dd1f460"
dependencies = [ dependencies = [
"alloy-eips", "alloy-eips",
"alloy-primitives", "alloy-primitives",
@@ -208,9 +208,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-json-rpc" name = "alloy-json-rpc"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b17c5ada5faf0f9d2921e8b20971eced68abbc92a272b0502cac8b1d00f56777" checksum = "2008bedb8159a255b46b7c8614516eda06679ea82f620913679afbd8031fea72"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
"alloy-sol-types", "alloy-sol-types",
@@ -222,9 +222,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-network" name = "alloy-network"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24f3117647e3262f6db9e18b371bf67c5810270c0cf915786c30fad3b1739561" checksum = "4556f01fe41d0677495df10a648ddcf7ce118b0e8aa9642a0e2b6dd1fb7259de"
dependencies = [ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-consensus-any", "alloy-consensus-any",
@@ -247,9 +247,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-network-primitives" name = "alloy-network-primitives"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1535a4577648ec2fd3c446d4644d9b8e9e01e5816be53a5d515dc1624e2227b2" checksum = "f31c3c6b71340a1d076831823f09cb6e02de01de5c6630a9631bdb36f947ff80"
dependencies = [ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-eips", "alloy-eips",
@@ -260,9 +260,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-node-bindings" name = "alloy-node-bindings"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf741e871fb62c80e0007041e8bc1e81978abfd98aafea8354472f06bfd4d309" checksum = "4520cd4bc5cec20c32c98e4bc38914c7fb96bf4a712105e44da186a54e65e3ba"
dependencies = [ dependencies = [
"alloy-genesis", "alloy-genesis",
"alloy-primitives", "alloy-primitives",
@@ -277,9 +277,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-primitives" name = "alloy-primitives"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6259a506ab13e1d658796c31e6e39d2e2ee89243bcc505ddc613b35732e0a430" checksum = "0540fd0355d400b59633c27bd4b42173e59943f28e9d3376b77a24771d432d04"
dependencies = [ dependencies = [
"alloy-rlp", "alloy-rlp",
"bytes", "bytes",
@@ -305,9 +305,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-provider" name = "alloy-provider"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcfa2db03d4221b5ca14bff7dbed4712689cb87a3e826af522468783ff05ec5d" checksum = "5a22c4441b3ebe2d77fa9cf629ba68c3f713eb91779cff84275393db97eddd82"
dependencies = [ dependencies = [
"alloy-chains", "alloy-chains",
"alloy-consensus", "alloy-consensus",
@@ -356,14 +356,14 @@ checksum = "5a833d97bf8a5f0f878daf2c8451fff7de7f9de38baa5a45d936ec718d81255a"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
name = "alloy-rpc-client" name = "alloy-rpc-client"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2ec6963b08f1c6ef8eacc01dbba20f2c6a1533550403f6b52dbbe0da0360834" checksum = "d06a292b37e182e514903ede6e623b9de96420e8109ce300da288a96d88b7e4b"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc",
"alloy-primitives", "alloy-primitives",
@@ -382,9 +382,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-rpc-types-any" name = "alloy-rpc-types-any"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c64a83112b09bd293ef522bfa3800fa2d2df4d72f2bcd3a84b08490503b22e55" checksum = "ca445cef0eb6c2cf51cfb4e214fbf1ebd00893ae2e6f3b944c8101b07990f988"
dependencies = [ dependencies = [
"alloy-consensus-any", "alloy-consensus-any",
"alloy-rpc-types-eth", "alloy-rpc-types-eth",
@@ -393,9 +393,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-rpc-types-eth" name = "alloy-rpc-types-eth"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5fc1892a1ac0d2a49c063f0791aa6bde342f020c5d37aaaec14832b661802cb4" checksum = "0938bc615c02421bd86c1733ca7205cc3d99a122d9f9bff05726bd604b76a5c2"
dependencies = [ dependencies = [
"alloy-consensus", "alloy-consensus",
"alloy-consensus-any", "alloy-consensus-any",
@@ -413,9 +413,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-serde" name = "alloy-serde"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17939f6bef49268e4494158fce1ab8913cd6164ec3f9a4ada2c677b9b5a77f2f" checksum = "ae0465c71d4dced7525f408d84873aeebb71faf807d22d74c4a426430ccd9b55"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
"serde", "serde",
@@ -424,9 +424,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-signer" name = "alloy-signer"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77d1f0762a44338f0e05987103bd5919df52170d949080bfebfeb6aaaa867c39" checksum = "9bfa395ad5cc952c82358d31e4c68b27bf4a89a5456d9b27e226e77dac50e4ff"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
"async-trait", "async-trait",
@@ -449,23 +449,23 @@ dependencies = [
[[package]] [[package]]
name = "alloy-sol-macro" name = "alloy-sol-macro"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9d64f851d95619233f74b310f12bcf16e0cbc27ee3762b6115c14a84809280a" checksum = "c6d1a14b4a9f6078ad9132775a2ebb465b06b387d60f7413ddc86d7bf7453408"
dependencies = [ dependencies = [
"alloy-sol-macro-expander", "alloy-sol-macro-expander",
"alloy-sol-macro-input", "alloy-sol-macro-input",
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
name = "alloy-sol-macro-expander" name = "alloy-sol-macro-expander"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6bf7ed1574b699f48bf17caab4e6e54c6d12bc3c006ab33d58b1e227c1c3559f" checksum = "4436b4b96d265eb17daea26eb31525c3076d024d10901e446790afbd2f7eeaf5"
dependencies = [ dependencies = [
"alloy-sol-macro-input", "alloy-sol-macro-input",
"const-hex", "const-hex",
@@ -474,31 +474,31 @@ dependencies = [
"proc-macro-error2", "proc-macro-error2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
"syn-solidity", "syn-solidity",
"tiny-keccak", "tiny-keccak",
] ]
[[package]] [[package]]
name = "alloy-sol-macro-input" name = "alloy-sol-macro-input"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c02997ccef5f34f9c099277d4145f183b422938ed5322dc57a089fe9b9ad9ee" checksum = "e5f58698a18b96faa8513519de112b79a96010b4ff84264ce54a217c52a8e98b"
dependencies = [ dependencies = [
"const-hex", "const-hex",
"dunce", "dunce",
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
"syn-solidity", "syn-solidity",
] ]
[[package]] [[package]]
name = "alloy-sol-types" name = "alloy-sol-types"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1174cafd6c6d810711b4e00383037bdb458efc4fe3dbafafa16567e0320c54d8" checksum = "c766e4979fc19d70057150befe8e3ea3f0c4cbc6839b8eaaa250803451692305"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
"alloy-sol-macro", "alloy-sol-macro",
@@ -507,9 +507,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-transport" name = "alloy-transport"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3a3827275a4eed3431ce876a59c76fd19effc2a8c09566b2603e3a3376d38af0" checksum = "d17722a198f33bbd25337660787aea8b8f57814febb7c746bc30407bdfc39448"
dependencies = [ dependencies = [
"alloy-json-rpc", "alloy-json-rpc",
"base64 0.22.1", "base64 0.22.1",
@@ -527,9 +527,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-transport-http" name = "alloy-transport-http"
version = "0.9.0" version = "0.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "958417ddf333c55b0627cb7fbee7c6666895061dee79f50404dd6dbdd8e9eba0" checksum = "6e1509599021330a31c4a6816b655e34bf67acb1cc03c564e09fd8754ff6c5de"
dependencies = [ dependencies = [
"alloy-transport", "alloy-transport",
"url", "url",
@@ -537,9 +537,9 @@ dependencies = [
[[package]] [[package]]
name = "alloy-trie" name = "alloy-trie"
version = "0.7.7" version = "0.7.8"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e428104b2445a4f929030891b3dbf8c94433a8349ba6480946bf6af7975c2f6" checksum = "6917c79e837aa7b77b7a6dae9f89cbe15313ac161c4d3cfaf8909ef21f3d22d8"
dependencies = [ dependencies = [
"alloy-primitives", "alloy-primitives",
"alloy-rlp", "alloy-rlp",
@@ -889,18 +889,18 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.83" version = "0.1.84"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" checksum = "1b1244b10dcd56c92219da4e14caa97e312079e185f04ba3eea25061561dc0a0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -935,7 +935,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -1046,7 +1046,7 @@ dependencies = [
"regex", "regex",
"rustc-hash 1.1.0", "rustc-hash 1.1.0",
"shlex", "shlex",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -1322,7 +1322,7 @@ dependencies = [
"proc-macro-crate 3.2.0", "proc-macro-crate 3.2.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -1348,9 +1348,9 @@ dependencies = [
[[package]] [[package]]
name = "bstr" name = "bstr"
version = "1.11.1" version = "1.11.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0"
dependencies = [ dependencies = [
"memchr", "memchr",
"serde", "serde",
@@ -1635,7 +1635,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -1973,7 +1973,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2001,7 +2001,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"scratch", "scratch",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2019,7 +2019,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2160,7 +2160,7 @@ checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
"unicode-xid", "unicode-xid",
] ]
@@ -2240,7 +2240,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2493,7 +2493,7 @@ dependencies = [
"heck 0.5.0", "heck 0.5.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2528,7 +2528,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
dependencies = [ dependencies = [
"libc", "libc",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -2597,7 +2597,7 @@ dependencies = [
"fs-err", "fs-err",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2878,7 +2878,7 @@ dependencies = [
"proc-macro-warning", "proc-macro-warning",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2890,7 +2890,7 @@ dependencies = [
"proc-macro-crate 1.3.1", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -2900,7 +2900,7 @@ source = "git+https://github.com/serai-dex/substrate#6e3f07bf5c98a6a3ec15f2b1a46
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -3059,7 +3059,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -3260,9 +3260,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f"
[[package]] [[package]]
name = "glob" name = "glob"
version = "0.3.1" version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2"
[[package]] [[package]]
name = "globset" name = "globset"
@@ -3548,7 +3548,7 @@ dependencies = [
"httpdate", "httpdate",
"itoa", "itoa",
"pin-project-lite", "pin-project-lite",
"socket2 0.5.8", "socket2 0.4.10",
"tokio", "tokio",
"tower-service", "tower-service",
"tracing", "tracing",
@@ -3795,7 +3795,7 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -4112,7 +4112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"windows-targets 0.52.6", "windows-targets 0.48.5",
] ]
[[package]] [[package]]
@@ -4486,7 +4486,7 @@ dependencies = [
"proc-macro-warning", "proc-macro-warning",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -4749,7 +4749,7 @@ dependencies = [
"macro_magic_core", "macro_magic_core",
"macro_magic_macros", "macro_magic_macros",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -4763,7 +4763,7 @@ dependencies = [
"macro_magic_core_macros", "macro_magic_core_macros",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -4774,7 +4774,7 @@ checksum = "d710e1214dffbab3b5dacb21475dde7d6ed84c69ff722b3a47a782668d44fbac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -4785,7 +4785,7 @@ checksum = "b8fb85ec1620619edf2984a7693497d4ec88a9665d8b87e942856884c92dbf2a"
dependencies = [ dependencies = [
"macro_magic_core", "macro_magic_core",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -5589,14 +5589,14 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
name = "nybbles" name = "nybbles"
version = "0.3.0" version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "55a62e678a89501192cc5ebf47dcbc656b608ae5e1c61c9251fe35230f119fe3" checksum = "a3409fc85ac27b27d971ea7cd1aabafd2eefa6de7e481c8d4f707225c117e81a"
dependencies = [ dependencies = [
"const-hex", "const-hex",
"serde", "serde",
@@ -6041,7 +6041,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -6263,7 +6263,7 @@ dependencies = [
"proc-macro-error-attr2", "proc-macro-error-attr2",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -6274,7 +6274,7 @@ checksum = "3d1eaa7fa0aa1929ffdf7eeb6eac234dde6268914a14ad44d23521ab6a9b258e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -6320,7 +6320,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -6631,7 +6631,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -6907,7 +6907,7 @@ dependencies = [
"errno", "errno",
"libc", "libc",
"linux-raw-sys", "linux-raw-sys",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -6977,9 +6977,9 @@ dependencies = [
[[package]] [[package]]
name = "rustversion" name = "rustversion"
version = "1.0.18" version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4"
[[package]] [[package]]
name = "rusty-fork" name = "rusty-fork"
@@ -7132,7 +7132,7 @@ dependencies = [
"proc-macro-crate 1.3.1", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -7893,7 +7893,7 @@ dependencies = [
"proc-macro-crate 1.3.1", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -7976,7 +7976,7 @@ dependencies = [
"proc-macro-crate 3.2.0", "proc-macro-crate 3.2.0",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -7990,9 +7990,9 @@ dependencies = [
[[package]] [[package]]
name = "schnellru" name = "schnellru"
version = "0.2.3" version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649"
dependencies = [ dependencies = [
"ahash", "ahash",
"cfg-if", "cfg-if",
@@ -8891,7 +8891,7 @@ dependencies = [
"serai-processor-ethereum-deployer", "serai-processor-ethereum-deployer",
"serai-processor-ethereum-erc20", "serai-processor-ethereum-erc20",
"serai-processor-ethereum-primitives", "serai-processor-ethereum-primitives",
"syn 2.0.91", "syn 2.0.94",
"syn-solidity", "syn-solidity",
"tokio", "tokio",
] ]
@@ -9236,9 +9236,9 @@ dependencies = [
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.216" version = "1.0.217"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
@@ -9254,13 +9254,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.216" version = "1.0.217"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -9283,7 +9283,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -9576,7 +9576,7 @@ dependencies = [
"proc-macro-crate 1.3.1", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -9772,7 +9772,7 @@ source = "git+https://github.com/serai-dex/substrate#6e3f07bf5c98a6a3ec15f2b1a46
dependencies = [ dependencies = [
"quote", "quote",
"sp-core-hashing", "sp-core-hashing",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -9791,7 +9791,7 @@ source = "git+https://github.com/serai-dex/substrate#6e3f07bf5c98a6a3ec15f2b1a46
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -9963,7 +9963,7 @@ dependencies = [
"proc-macro-crate 1.3.1", "proc-macro-crate 1.3.1",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10116,7 +10116,7 @@ dependencies = [
"parity-scale-codec", "parity-scale-codec",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10304,7 +10304,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10317,7 +10317,7 @@ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"rustversion", "rustversion",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10405,9 +10405,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.91" version = "2.0.94"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d53cbcb5a243bd33b7858b1d7f4aca2153490815872d86d955d6ea29f743c035" checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -10416,14 +10416,14 @@ dependencies = [
[[package]] [[package]]
name = "syn-solidity" name = "syn-solidity"
version = "0.8.15" version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "219389c1ebe89f8333df8bdfb871f6631c552ff399c23cac02480b6088aad8f0" checksum = "c74af950d86ec0f5b2ae2d7f1590bbfbcf4603a0a15742d8f98132ac4fe3efd4"
dependencies = [ dependencies = [
"paste", "paste",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10479,15 +10479,16 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.14.0" version = "3.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"fastrand", "fastrand",
"getrandom",
"once_cell", "once_cell",
"rustix", "rustix",
"windows-sys 0.59.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -10547,7 +10548,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10558,7 +10559,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10680,7 +10681,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -10770,7 +10771,7 @@ checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5"
dependencies = [ dependencies = [
"indexmap 2.7.0", "indexmap 2.7.0",
"toml_datetime", "toml_datetime",
"winnow 0.6.20", "winnow 0.6.21",
] ]
[[package]] [[package]]
@@ -10848,7 +10849,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -11286,7 +11287,7 @@ dependencies = [
"log", "log",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -11321,7 +11322,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
"wasm-bindgen-backend", "wasm-bindgen-backend",
"wasm-bindgen-shared", "wasm-bindgen-shared",
] ]
@@ -11630,7 +11631,7 @@ checksum = "ca7af9bb3ee875c4907835e607a275d10b04d15623d3aebe01afe8fbd3f85050"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -11713,7 +11714,7 @@ version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb"
dependencies = [ dependencies = [
"windows-sys 0.59.0", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
@@ -11772,7 +11773,7 @@ checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -11783,7 +11784,7 @@ checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -11964,9 +11965,9 @@ dependencies = [
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.6.20" version = "0.6.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" checksum = "e6f5bb5257f2407a5425c6e749bfd9692192a73e70a6060516ac04f889087d68"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -12084,7 +12085,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]
@@ -12104,7 +12105,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.91", "syn 2.0.94",
] ]
[[package]] [[package]]

View File

@@ -39,7 +39,7 @@ serai-db = { path = "../common/db" }
serai-env = { path = "../common/env" } serai-env = { path = "../common/env" }
serai-task = { path = "../common/task", version = "0.1" } serai-task = { path = "../common/task", version = "0.1" }
processor-messages = { package = "serai-processor-messages", path = "../processor/messages" } messages = { package = "serai-processor-messages", path = "../processor/messages" }
message-queue = { package = "serai-message-queue", path = "../message-queue" } message-queue = { package = "serai-message-queue", path = "../message-queue" }
tributary = { package = "tributary-chain", path = "./tributary" } tributary = { package = "tributary-chain", path = "./tributary" }

View File

@@ -5,7 +5,7 @@ use borsh::{BorshSerialize, BorshDeserialize};
use serai_client::{primitives::SeraiAddress, validator_sets::primitives::ValidatorSet}; use serai_client::{primitives::SeraiAddress, validator_sets::primitives::ValidatorSet};
use processor_messages::sign::VariantSignId; use messages::sign::{VariantSignId, SignId};
use serai_db::*; use serai_db::*;
@@ -13,20 +13,20 @@ use crate::tributary::transaction::SigningProtocolRound;
/// A topic within the database which the group participates in /// A topic within the database which the group participates in
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, BorshSerialize, BorshDeserialize)] #[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, BorshSerialize, BorshDeserialize)]
pub enum Topic { pub(crate) enum Topic {
/// Vote to remove a participant /// Vote to remove a participant
RemoveParticipant { participant: SeraiAddress }, RemoveParticipant { participant: SeraiAddress },
// DkgParticipation isn't represented here as participations are immediately sent to the // DkgParticipation isn't represented here as participations are immediately sent to the
// processor, not accumulated within this databse // processor, not accumulated within this databse
/// Participation in the signing protocol to confirm the DKG results on Substrate /// Participation in the signing protocol to confirm the DKG results on Substrate
DkgConfirmation { attempt: u32, label: SigningProtocolRound }, DkgConfirmation { attempt: u32, round: SigningProtocolRound },
/// The local view of the SlashReport, to be aggregated into the final SlashReport /// The local view of the SlashReport, to be aggregated into the final SlashReport
SlashReport, SlashReport,
/// Participation in a signing protocol /// Participation in a signing protocol
Sign { id: VariantSignId, attempt: u32, label: SigningProtocolRound }, Sign { id: VariantSignId, attempt: u32, round: SigningProtocolRound },
} }
enum Participating { enum Participating {
@@ -40,13 +40,13 @@ impl Topic {
#[allow(clippy::match_same_arms)] #[allow(clippy::match_same_arms)]
match self { match self {
Topic::RemoveParticipant { .. } => None, Topic::RemoveParticipant { .. } => None,
Topic::DkgConfirmation { attempt, label: _ } => Some(Topic::DkgConfirmation { Topic::DkgConfirmation { attempt, round: _ } => Some(Topic::DkgConfirmation {
attempt: attempt + 1, attempt: attempt + 1,
label: SigningProtocolRound::Preprocess, round: SigningProtocolRound::Preprocess,
}), }),
Topic::SlashReport { .. } => None, Topic::SlashReport { .. } => None,
Topic::Sign { id, attempt, label: _ } => { Topic::Sign { id, attempt, round: _ } => {
Some(Topic::Sign { id, attempt: attempt + 1, label: SigningProtocolRound::Preprocess }) Some(Topic::Sign { id, attempt: attempt + 1, round: SigningProtocolRound::Preprocess })
} }
} }
} }
@@ -56,27 +56,40 @@ impl Topic {
#[allow(clippy::match_same_arms)] #[allow(clippy::match_same_arms)]
match self { match self {
Topic::RemoveParticipant { .. } => None, Topic::RemoveParticipant { .. } => None,
Topic::DkgConfirmation { attempt, label } => match label { Topic::DkgConfirmation { attempt, round } => match round {
SigningProtocolRound::Preprocess => { SigningProtocolRound::Preprocess => {
let attempt = attempt + 1; let attempt = attempt + 1;
Some(( Some((
attempt, attempt,
Topic::DkgConfirmation { attempt, label: SigningProtocolRound::Preprocess }, Topic::DkgConfirmation { attempt, round: SigningProtocolRound::Preprocess },
)) ))
} }
SigningProtocolRound::Share => None, SigningProtocolRound::Share => None,
}, },
Topic::SlashReport { .. } => None, Topic::SlashReport { .. } => None,
Topic::Sign { id, attempt, label } => match label { Topic::Sign { id, attempt, round } => match round {
SigningProtocolRound::Preprocess => { SigningProtocolRound::Preprocess => {
let attempt = attempt + 1; let attempt = attempt + 1;
Some((attempt, Topic::Sign { id, attempt, label: SigningProtocolRound::Preprocess })) Some((attempt, Topic::Sign { id, attempt, round: SigningProtocolRound::Preprocess }))
} }
SigningProtocolRound::Share => None, SigningProtocolRound::Share => None,
}, },
} }
} }
// The SignId for this topic
//
// Returns None if Topic isn't Topic::Sign
pub(crate) fn sign_id(self, set: ValidatorSet) -> Option<messages::sign::SignId> {
#[allow(clippy::match_same_arms)]
match self {
Topic::RemoveParticipant { .. } => None,
Topic::DkgConfirmation { .. } => None,
Topic::SlashReport { .. } => None,
Topic::Sign { id, attempt, round: _ } => Some(SignId { session: set.session, id, attempt }),
}
}
/// The topic which precedes this topic as a prerequisite /// The topic which precedes this topic as a prerequisite
/// ///
/// The preceding topic must define this topic as succeeding /// The preceding topic must define this topic as succeeding
@@ -84,17 +97,17 @@ impl Topic {
#[allow(clippy::match_same_arms)] #[allow(clippy::match_same_arms)]
match self { match self {
Topic::RemoveParticipant { .. } => None, Topic::RemoveParticipant { .. } => None,
Topic::DkgConfirmation { attempt, label } => match label { Topic::DkgConfirmation { attempt, round } => match round {
SigningProtocolRound::Preprocess => None, SigningProtocolRound::Preprocess => None,
SigningProtocolRound::Share => { SigningProtocolRound::Share => {
Some(Topic::DkgConfirmation { attempt, label: SigningProtocolRound::Preprocess }) Some(Topic::DkgConfirmation { attempt, round: SigningProtocolRound::Preprocess })
} }
}, },
Topic::SlashReport { .. } => None, Topic::SlashReport { .. } => None,
Topic::Sign { id, attempt, label } => match label { Topic::Sign { id, attempt, round } => match round {
SigningProtocolRound::Preprocess => None, SigningProtocolRound::Preprocess => None,
SigningProtocolRound::Share => { SigningProtocolRound::Share => {
Some(Topic::Sign { id, attempt, label: SigningProtocolRound::Preprocess }) Some(Topic::Sign { id, attempt, round: SigningProtocolRound::Preprocess })
} }
}, },
} }
@@ -107,16 +120,16 @@ impl Topic {
#[allow(clippy::match_same_arms)] #[allow(clippy::match_same_arms)]
match self { match self {
Topic::RemoveParticipant { .. } => None, Topic::RemoveParticipant { .. } => None,
Topic::DkgConfirmation { attempt, label } => match label { Topic::DkgConfirmation { attempt, round } => match round {
SigningProtocolRound::Preprocess => { SigningProtocolRound::Preprocess => {
Some(Topic::DkgConfirmation { attempt, label: SigningProtocolRound::Share }) Some(Topic::DkgConfirmation { attempt, round: SigningProtocolRound::Share })
} }
SigningProtocolRound::Share => None, SigningProtocolRound::Share => None,
}, },
Topic::SlashReport { .. } => None, Topic::SlashReport { .. } => None,
Topic::Sign { id, attempt, label } => match label { Topic::Sign { id, attempt, round } => match round {
SigningProtocolRound::Preprocess => { SigningProtocolRound::Preprocess => {
Some(Topic::Sign { id, attempt, label: SigningProtocolRound::Share }) Some(Topic::Sign { id, attempt, round: SigningProtocolRound::Share })
} }
SigningProtocolRound::Share => None, SigningProtocolRound::Share => None,
}, },
@@ -155,7 +168,7 @@ impl Topic {
} }
/// The resulting data set from an accumulation /// The resulting data set from an accumulation
pub enum DataSet<D: Borshy> { pub(crate) enum DataSet<D: Borshy> {
/// Accumulating this did not produce a data set to act on /// Accumulating this did not produce a data set to act on
/// (non-existent, not ready, prior handled, not participating, etc.) /// (non-existent, not ready, prior handled, not participating, etc.)
None, None,
@@ -187,15 +200,21 @@ create_db!(
} }
); );
pub struct TributaryDb; db_channel!(
CoordinatorTributary {
ProcessorMessages: (set: ValidatorSet) -> messages::CoordinatorMessage,
}
);
pub(crate) struct TributaryDb;
impl TributaryDb { impl TributaryDb {
pub fn last_handled_tributary_block( pub(crate) fn last_handled_tributary_block(
getter: &impl Get, getter: &impl Get,
set: ValidatorSet, set: ValidatorSet,
) -> Option<(u64, [u8; 32])> { ) -> Option<(u64, [u8; 32])> {
LastHandledTributaryBlock::get(getter, set) LastHandledTributaryBlock::get(getter, set)
} }
pub fn set_last_handled_tributary_block( pub(crate) fn set_last_handled_tributary_block(
txn: &mut impl DbTxn, txn: &mut impl DbTxn,
set: ValidatorSet, set: ValidatorSet,
block_number: u64, block_number: u64,
@@ -204,18 +223,35 @@ impl TributaryDb {
LastHandledTributaryBlock::set(txn, set, &(block_number, block_hash)); LastHandledTributaryBlock::set(txn, set, &(block_number, block_hash));
} }
pub fn recognize_topic(txn: &mut impl DbTxn, set: ValidatorSet, topic: Topic) { pub(crate) fn latest_substrate_block_to_cosign(
getter: &impl Get,
set: ValidatorSet,
) -> Option<[u8; 32]> {
LatestSubstrateBlockToCosign::get(getter, set)
}
pub(crate) fn set_latest_substrate_block_to_cosign(
txn: &mut impl DbTxn,
set: ValidatorSet,
substrate_block_hash: [u8; 32],
) {
LatestSubstrateBlockToCosign::set(txn, set, &substrate_block_hash);
}
pub(crate) fn recognize_topic(txn: &mut impl DbTxn, set: ValidatorSet, topic: Topic) {
AccumulatedWeight::set(txn, set, topic, &0); AccumulatedWeight::set(txn, set, topic, &0);
} }
pub fn start_of_block(txn: &mut impl DbTxn, set: ValidatorSet, block_number: u64) { pub(crate) fn start_of_block(txn: &mut impl DbTxn, set: ValidatorSet, block_number: u64) {
for topic in Reattempt::take(txn, set, block_number).unwrap_or(vec![]) { for topic in Reattempt::take(txn, set, block_number).unwrap_or(vec![]) {
// TODO: Slash all people who preprocessed but didn't share // TODO: Slash all people who preprocessed but didn't share
Self::recognize_topic(txn, set, topic); Self::recognize_topic(txn, set, topic);
if let Some(id) = topic.sign_id(set) {
Self::send_message(txn, set, messages::sign::CoordinatorMessage::Reattempt { id });
}
} }
} }
pub fn fatal_slash( pub(crate) fn fatal_slash(
txn: &mut impl DbTxn, txn: &mut impl DbTxn,
set: ValidatorSet, set: ValidatorSet,
validator: SeraiAddress, validator: SeraiAddress,
@@ -225,12 +261,16 @@ impl TributaryDb {
SlashPoints::set(txn, set, validator, &u64::MAX); SlashPoints::set(txn, set, validator, &u64::MAX);
} }
pub fn is_fatally_slashed(getter: &impl Get, set: ValidatorSet, validator: SeraiAddress) -> bool { pub(crate) fn is_fatally_slashed(
getter: &impl Get,
set: ValidatorSet,
validator: SeraiAddress,
) -> bool {
SlashPoints::get(getter, set, validator).unwrap_or(0) == u64::MAX SlashPoints::get(getter, set, validator).unwrap_or(0) == u64::MAX
} }
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
pub fn accumulate<D: Borshy>( pub(crate) fn accumulate<D: Borshy>(
txn: &mut impl DbTxn, txn: &mut impl DbTxn,
set: ValidatorSet, set: ValidatorSet,
validators: &[SeraiAddress], validators: &[SeraiAddress],
@@ -286,7 +326,8 @@ impl TributaryDb {
// Check if we now cross the weight threshold // Check if we now cross the weight threshold
if accumulated_weight >= topic.required_participation(total_weight) { if accumulated_weight >= topic.required_participation(total_weight) {
// Queue this for re-attempt after enough time passes // Queue this for re-attempt after enough time passes
if let Some((attempt, reattempt_topic)) = topic.reattempt_topic() { let reattempt_topic = topic.reattempt_topic();
if let Some((attempt, reattempt_topic)) = reattempt_topic {
// 5 minutes // 5 minutes
#[cfg(not(feature = "longer-reattempts"))] #[cfg(not(feature = "longer-reattempts"))]
const BASE_REATTEMPT_DELAY: u32 = const BASE_REATTEMPT_DELAY: u32 =
@@ -316,15 +357,11 @@ impl TributaryDb {
let mut data_set = HashMap::with_capacity(validators.len()); let mut data_set = HashMap::with_capacity(validators.len());
for validator in validators { for validator in validators {
if let Some(data) = Accumulated::<D>::get(txn, set, topic, *validator) { if let Some(data) = Accumulated::<D>::get(txn, set, topic, *validator) {
// Clean this data up if there's not a succeeding topic // Clean this data up if there's not a re-attempt topic
// If there is, we wait as the succeeding topic checks our participation in this topic // If there is a re-attempt topic, we clean it up upon re-attempt
if succeeding_topic.is_none() { if reattempt_topic.is_none() {
Accumulated::<D>::del(txn, set, topic, *validator); Accumulated::<D>::del(txn, set, topic, *validator);
} }
// If this *was* the succeeding topic, clean up the preceding topic's data
if let Some(preceding_topic) = preceding_topic {
Accumulated::<D>::del(txn, set, preceding_topic, *validator);
}
data_set.insert(*validator, data); data_set.insert(*validator, data);
} }
} }
@@ -343,4 +380,12 @@ impl TributaryDb {
DataSet::None DataSet::None
} }
} }
pub(crate) fn send_message(
txn: &mut impl DbTxn,
set: ValidatorSet,
message: impl Into<messages::CoordinatorMessage>,
) {
ProcessorMessages::send(txn, set, &message.into());
}
} }

View File

@@ -3,10 +3,13 @@ use std::collections::HashMap;
use ciphersuite::group::GroupEncoding; use ciphersuite::group::GroupEncoding;
use serai_client::{primitives::SeraiAddress, validator_sets::primitives::ValidatorSet}; use serai_client::{
primitives::SeraiAddress,
validator_sets::primitives::{ValidatorSet, Slash},
};
use tributary::{ use tributary::{
Signed as TributarySigned, TransactionError, TransactionKind, TransactionTrait, Signed as TributarySigned, TransactionKind, TransactionTrait,
Transaction as TributaryTransaction, Block, TributaryReader, Transaction as TributaryTransaction, Block, TributaryReader,
tendermint::{ tendermint::{
tx::{TendermintTx, Evidence, decode_signed_message}, tx::{TendermintTx, Evidence, decode_signed_message},
@@ -17,9 +20,11 @@ use tributary::{
use serai_db::*; use serai_db::*;
use serai_task::ContinuallyRan; use serai_task::ContinuallyRan;
use messages::sign::VariantSignId;
use crate::tributary::{ use crate::tributary::{
db::*, db::*,
transaction::{Signed, Transaction}, transaction::{SigningProtocolRound, Signed, Transaction},
}; };
struct ScanBlock<'a, D: DbTxn, TD: Db> { struct ScanBlock<'a, D: DbTxn, TD: Db> {
@@ -43,9 +48,21 @@ impl<'a, D: DbTxn, TD: Db> ScanBlock<'a, D, TD> {
} }
match tx { match tx {
// Accumulate this vote and fatally slash the participant if past the threshold
Transaction::RemoveParticipant { participant, signed } => { Transaction::RemoveParticipant { participant, signed } => {
// Accumulate this vote and fatally slash the participant if past the threshold
let signer = signer(signed); let signer = signer(signed);
// Check the participant voted to be removed actually exists
if !self.validators.iter().any(|validator| *validator == participant) {
TributaryDb::fatal_slash(
self.txn,
self.set,
signer,
"voted to remove non-existent participant",
);
return;
}
match TributaryDb::accumulate( match TributaryDb::accumulate(
self.txn, self.txn,
self.set, self.set,
@@ -59,14 +76,22 @@ impl<'a, D: DbTxn, TD: Db> ScanBlock<'a, D, TD> {
) { ) {
DataSet::None => {} DataSet::None => {}
DataSet::Participating(_) => { DataSet::Participating(_) => {
TributaryDb::fatal_slash(self.txn, self.set, participant, "voted to remove") TributaryDb::fatal_slash(self.txn, self.set, participant, "voted to remove");
} }
} };
} }
// Send the participation to the processor
Transaction::DkgParticipation { participation, signed } => { Transaction::DkgParticipation { participation, signed } => {
// Send the participation to the processor TributaryDb::send_message(
todo!("TODO") self.txn,
self.set,
messages::key_gen::CoordinatorMessage::Participation {
session: self.set.session,
participant: todo!("TODO"),
participation,
},
);
} }
Transaction::DkgConfirmationPreprocess { attempt, preprocess, signed } => { Transaction::DkgConfirmationPreprocess { attempt, preprocess, signed } => {
// Accumulate the preprocesses into our own FROST attempt manager // Accumulate the preprocesses into our own FROST attempt manager
@@ -79,11 +104,42 @@ impl<'a, D: DbTxn, TD: Db> ScanBlock<'a, D, TD> {
Transaction::Cosign { substrate_block_hash } => { Transaction::Cosign { substrate_block_hash } => {
// Update the latest intended-to-be-cosigned Substrate block // Update the latest intended-to-be-cosigned Substrate block
todo!("TODO") TributaryDb::set_latest_substrate_block_to_cosign(self.txn, self.set, substrate_block_hash);
// TODO: If we aren't currently cosigning a block, start cosigning this one
} }
Transaction::Cosigned { substrate_block_hash } => { Transaction::Cosigned { substrate_block_hash } => {
// Start cosigning the latest intended-to-be-cosigned block // Start cosigning the latest intended-to-be-cosigned block
todo!("TODO") let Some(latest_substrate_block_to_cosign) =
TributaryDb::latest_substrate_block_to_cosign(self.txn, self.set)
else {
return;
};
// If this is the block we just cosigned, return
if latest_substrate_block_to_cosign == substrate_block_hash {
return;
}
let substrate_block_number = todo!("TODO");
// Whitelist the topic
TributaryDb::recognize_topic(
self.txn,
self.set,
Topic::Sign {
id: VariantSignId::Cosign(substrate_block_number),
attempt: 0,
round: SigningProtocolRound::Preprocess,
},
);
// Send the message for the processor to start signing
TributaryDb::send_message(
self.txn,
self.set,
messages::coordinator::CoordinatorMessage::CosignSubstrateBlock {
session: self.set.session,
block_number: substrate_block_number,
block: substrate_block_hash,
},
);
} }
Transaction::SubstrateBlock { hash } => { Transaction::SubstrateBlock { hash } => {
// Whitelist all of the IDs this Substrate block causes to be signed // Whitelist all of the IDs this Substrate block causes to be signed
@@ -95,11 +151,148 @@ impl<'a, D: DbTxn, TD: Db> ScanBlock<'a, D, TD> {
} }
Transaction::SlashReport { slash_points, signed } => { Transaction::SlashReport { slash_points, signed } => {
let signer = signer(signed);
if slash_points.len() != self.validators.len() {
TributaryDb::fatal_slash(
self.txn,
self.set,
signer,
"slash report was for a distinct amount of signers",
);
return;
}
// Accumulate, and if past the threshold, calculate *the* slash report and start signing it // Accumulate, and if past the threshold, calculate *the* slash report and start signing it
todo!("TODO") match TributaryDb::accumulate(
self.txn,
self.set,
self.validators,
self.total_weight,
block_number,
Topic::SlashReport,
signer,
self.validator_weights[&signer],
&slash_points,
) {
DataSet::None => {}
DataSet::Participating(data_set) => {
// Find the median reported slashes for this validator
// TODO: This lets 34% perform a fatal slash. Should that be allowed?
let mut median_slash_report = Vec::with_capacity(self.validators.len());
for i in 0 .. self.validators.len() {
let mut this_validator =
data_set.values().map(|report| report[i]).collect::<Vec<_>>();
this_validator.sort_unstable();
// Choose the median, where if there are two median values, the lower one is chosen
let median_index = if (this_validator.len() % 2) == 1 {
this_validator.len() / 2
} else {
(this_validator.len() / 2) - 1
};
median_slash_report.push(this_validator[median_index]);
}
// We only publish slashes for the `f` worst performers to:
// 1) Effect amnesty if there were network disruptions which affected everyone
// 2) Ensure the signing threshold doesn't have a disincentive to do their job
// Find the worst performer within the signing threshold's slash points
let f = (self.validators.len() - 1) / 3;
let worst_validator_in_supermajority_slash_points = {
let mut sorted_slash_points = median_slash_report.clone();
sorted_slash_points.sort_unstable();
// This won't be a valid index if `f == 0`, which means we don't have any validators
// to slash
let index_of_first_validator_to_slash = self.validators.len() - f;
let index_of_worst_validator_in_supermajority = index_of_first_validator_to_slash - 1;
sorted_slash_points[index_of_worst_validator_in_supermajority]
};
// Perform the amortization
for slash_points in &mut median_slash_report {
*slash_points =
slash_points.saturating_sub(worst_validator_in_supermajority_slash_points)
}
let amortized_slash_report = median_slash_report;
// Create the resulting slash report
let mut slash_report = vec![];
for (validator, points) in self.validators.iter().copied().zip(amortized_slash_report) {
if points != 0 {
slash_report.push(Slash { key: validator.into(), points });
}
}
assert!(slash_report.len() <= f);
// Recognize the topic for signing the slash report
TributaryDb::recognize_topic(
self.txn,
self.set,
Topic::Sign {
id: VariantSignId::SlashReport,
attempt: 0,
round: SigningProtocolRound::Preprocess,
},
);
// Send the message for the processor to start signing
TributaryDb::send_message(
self.txn,
self.set,
messages::coordinator::CoordinatorMessage::SignSlashReport {
session: self.set.session,
report: slash_report,
},
);
}
};
} }
Transaction::Sign { id, attempt, label, data, signed } => todo!("TODO"), Transaction::Sign { id, attempt, round, data, signed } => {
let topic = Topic::Sign { id, attempt, round };
let signer = signer(signed);
if u64::try_from(data.len()).unwrap() != self.validator_weights[&signer] {
TributaryDb::fatal_slash(
self.txn,
self.set,
signer,
"signer signed with a distinct amount of key shares than they had key shares",
);
return;
}
match TributaryDb::accumulate(
self.txn,
self.set,
self.validators,
self.total_weight,
block_number,
topic,
signer,
self.validator_weights[&signer],
&data,
) {
DataSet::None => {}
DataSet::Participating(data_set) => {
let id = topic.sign_id(self.set).expect("Topic::Sign didn't have SignId");
let flatten_data_set = |data_set| todo!("TODO");
let data_set = flatten_data_set(data_set);
TributaryDb::send_message(
self.txn,
self.set,
match round {
SigningProtocolRound::Preprocess => {
messages::sign::CoordinatorMessage::Preprocesses { id, preprocesses: data_set }
}
SigningProtocolRound::Share => {
messages::sign::CoordinatorMessage::Shares { id, shares: data_set }
}
},
)
}
};
}
} }
} }

View File

@@ -14,9 +14,9 @@ use schnorr::SchnorrSignature;
use scale::Encode; use scale::Encode;
use borsh::{BorshSerialize, BorshDeserialize}; use borsh::{BorshSerialize, BorshDeserialize};
use serai_client::primitives::SeraiAddress; use serai_client::{primitives::SeraiAddress, validator_sets::primitives::MAX_KEY_SHARES_PER_SET};
use processor_messages::sign::VariantSignId; use messages::sign::VariantSignId;
use tributary::{ use tributary::{
ReadWrite, ReadWrite,
@@ -25,7 +25,7 @@ use tributary::{
}, },
}; };
/// The label for data from a signing protocol. /// The round this data is for, within a signing protocol.
#[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, BorshSerialize, BorshDeserialize)] #[derive(Clone, Copy, PartialEq, Eq, Debug, Encode, BorshSerialize, BorshDeserialize)]
pub enum SigningProtocolRound { pub enum SigningProtocolRound {
/// A preprocess. /// A preprocess.
@@ -182,8 +182,8 @@ pub enum Transaction {
id: VariantSignId, id: VariantSignId,
/// The attempt number of this signing protocol /// The attempt number of this signing protocol
attempt: u32, attempt: u32,
/// The label for this data within the signing protocol /// The round this data is for, within the signing protocol
label: SigningProtocolRound, round: SigningProtocolRound,
/// The data itself /// The data itself
/// ///
/// There will be `n` blobs of data where `n` is the amount of key shares the validator sending /// There will be `n` blobs of data where `n` is the amount of key shares the validator sending
@@ -234,8 +234,8 @@ impl TransactionTrait for Transaction {
Transaction::SubstrateBlock { .. } => TransactionKind::Provided("SubstrateBlock"), Transaction::SubstrateBlock { .. } => TransactionKind::Provided("SubstrateBlock"),
Transaction::Batch { .. } => TransactionKind::Provided("Batch"), Transaction::Batch { .. } => TransactionKind::Provided("Batch"),
Transaction::Sign { id, attempt, label, signed, .. } => { Transaction::Sign { id, attempt, round, signed, .. } => {
TransactionKind::Signed((b"Sign", id, attempt).encode(), signed.nonce(label.nonce())) TransactionKind::Signed((b"Sign", id, attempt).encode(), signed.nonce(round.nonce()))
} }
Transaction::SlashReport { signed, .. } => { Transaction::SlashReport { signed, .. } => {
@@ -253,9 +253,37 @@ impl TransactionTrait for Transaction {
Blake2b::<U32>::digest(&tx).into() Blake2b::<U32>::digest(&tx).into()
} }
// We don't have any verification logic embedded into the transaction. We just slash anyone who // This is a stateless verification which we use to enforce some size limits.
// publishes an invalid transaction.
fn verify(&self) -> Result<(), TransactionError> { fn verify(&self) -> Result<(), TransactionError> {
#[allow(clippy::match_same_arms)]
match self {
// Fixed-length TX
Transaction::RemoveParticipant { .. } => {}
// TODO: MAX_DKG_PARTICIPATION_LEN
Transaction::DkgParticipation { .. } => {}
// These are fixed-length TXs
Transaction::DkgConfirmationPreprocess { .. } | Transaction::DkgConfirmationShare { .. } => {}
// Provided TXs
Transaction::Cosign { .. } |
Transaction::Cosigned { .. } |
Transaction::SubstrateBlock { .. } |
Transaction::Batch { .. } => {}
Transaction::Sign { data, .. } => {
if data.len() > usize::try_from(MAX_KEY_SHARES_PER_SET).unwrap() {
Err(TransactionError::InvalidContent)?
}
// TODO: MAX_SIGN_LEN
}
Transaction::SlashReport { slash_points, .. } => {
if slash_points.len() > usize::try_from(MAX_KEY_SHARES_PER_SET).unwrap() {
Err(TransactionError::InvalidContent)?
}
}
};
Ok(()) Ok(())
} }
} }

View File

@@ -22,9 +22,13 @@ pub mod key_gen {
#[derive(Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)] #[derive(Clone, PartialEq, Eq, BorshSerialize, BorshDeserialize)]
pub enum CoordinatorMessage { pub enum CoordinatorMessage {
// Instructs the Processor to begin the key generation process. /// Instructs the Processor to begin the key generation process.
///
/// This is sent by the Coordinator when it creates the Tributary (TODO).
GenerateKey { session: Session, threshold: u16, evrf_public_keys: Vec<([u8; 32], Vec<u8>)> }, GenerateKey { session: Session, threshold: u16, evrf_public_keys: Vec<([u8; 32], Vec<u8>)> },
// Received participations for the specified key generation protocol. /// Received participations for the specified key generation protocol.
///
/// This is sent by the Coordinator's Tributary scanner.
Participation { session: Session, participant: Participant, participation: Vec<u8> }, Participation { session: Session, participant: Participant, participation: Vec<u8> },
} }
@@ -113,11 +117,17 @@ pub mod sign {
#[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)] #[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)]
pub enum CoordinatorMessage { pub enum CoordinatorMessage {
// Received preprocesses for the specified signing protocol. /// Received preprocesses for the specified signing protocol.
///
/// This is sent by the Coordinator's Tributary scanner.
Preprocesses { id: SignId, preprocesses: HashMap<Participant, Vec<u8>> }, Preprocesses { id: SignId, preprocesses: HashMap<Participant, Vec<u8>> },
// Received shares for the specified signing protocol. // Received shares for the specified signing protocol.
///
/// This is sent by the Coordinator's Tributary scanner.
Shares { id: SignId, shares: HashMap<Participant, Vec<u8>> }, Shares { id: SignId, shares: HashMap<Participant, Vec<u8>> },
// Re-attempt a signing protocol. // Re-attempt a signing protocol.
///
/// This is sent by the Coordinator's Tributary re-attempt scheduling logic.
Reattempt { id: SignId }, Reattempt { id: SignId },
} }
@@ -157,7 +167,13 @@ pub mod coordinator {
#[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)] #[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)]
pub enum CoordinatorMessage { pub enum CoordinatorMessage {
/// Cosign the specified Substrate block.
///
/// This is sent by the Coordinator's Tributary scanner.
CosignSubstrateBlock { session: Session, block_number: u64, block: [u8; 32] }, CosignSubstrateBlock { session: Session, block_number: u64, block: [u8; 32] },
/// Sign the slash report for this session.
///
/// This is sent by the Coordinator's Tributary scanner.
SignSlashReport { session: Session, report: Vec<Slash> }, SignSlashReport { session: Session, report: Vec<Slash> },
} }
@@ -196,12 +212,18 @@ pub mod substrate {
#[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)] #[derive(Clone, PartialEq, Eq, Debug, BorshSerialize, BorshDeserialize)]
pub enum CoordinatorMessage { pub enum CoordinatorMessage {
/// Keys set on the Serai blockchain. /// Keys set on the Serai blockchain.
///
/// This is set by the Coordinator's Substrate canonical event stream.
SetKeys { serai_time: u64, session: Session, key_pair: KeyPair }, SetKeys { serai_time: u64, session: Session, key_pair: KeyPair },
/// Slashes reported on the Serai blockchain OR the process timed out. /// Slashes reported on the Serai blockchain OR the process timed out.
/// ///
/// This is the final message for a session, /// This is the final message for a session,
///
/// This is set by the Coordinator's Substrate canonical event stream.
SlashesReported { session: Session }, SlashesReported { session: Session },
/// A block from Serai with relevance to this processor. /// A block from Serai with relevance to this processor.
///
/// This is set by the Coordinator's Substrate canonical event stream.
Block { Block {
serai_block_number: u64, serai_block_number: u64,
batch: Option<ExecutedBatch>, batch: Option<ExecutedBatch>,

View File

@@ -114,8 +114,8 @@ pub struct Slash {
deserialize_with = "serai_primitives::borsh_deserialize_public" deserialize_with = "serai_primitives::borsh_deserialize_public"
) )
)] )]
key: Public, pub key: Public,
points: u32, pub points: u32,
} }
#[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)] #[derive(Clone, PartialEq, Eq, Debug, Encode, Decode, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]