diff --git a/Cargo.lock b/Cargo.lock index cd7e65424d..595dca94d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -105,9 +105,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -498,7 +498,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror 1.0.68", + "thiserror 1.0.69", "time 0.3.37", ] @@ -594,8 +594,8 @@ checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" dependencies = [ "async-task", "concurrent-queue", - "fastrand 2.1.1", - "futures-lite 2.4.0", + "fastrand 2.3.0", + "futures-lite 2.5.0", "slab", ] @@ -607,10 +607,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.4.0", "blocking", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "once_cell", "tokio", ] @@ -654,18 +654,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "parking", "polling 3.7.4", - "rustix 0.38.39", + "rustix 0.38.42", "slab", "tracing", "windows-sys 0.59.0", @@ -699,7 +699,7 @@ checksum = "9e9e7a929bd34c68a82d58a4de7f86fffdaf97fb2af850162a7bb19dd7269b33" dependencies = [ "async-std", "native-tls", - "thiserror 1.0.68", + "thiserror 1.0.69", "url", ] @@ -710,15 +710,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63255f1dc2381611000436537bbedfe83183faa303a5a0edaf191edef06526bb" dependencies = [ "async-channel 2.3.1", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.4.0", "async-signal", "async-task", "blocking", "cfg-if", "event-listener 5.3.1", - "futures-lite 2.4.0", - "rustix 0.38.39", + "futures-lite 2.5.0", + "rustix 0.38.42", "tracing", ] @@ -728,13 +728,13 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "637e00349800c0bdf8bfc21ebbc0b6524abea702b0da4168ac00d070d0c0b9f3" dependencies = [ - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.39", + "rustix 0.38.42", "signal-hook-registry", "slab", "windows-sys 0.59.0", @@ -763,14 +763,14 @@ dependencies = [ "async-attributes", "async-channel 1.9.0", "async-global-executor", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.4.0", "async-process", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "gloo-timers", "kv-log-macro", "log", @@ -850,19 +850,6 @@ dependencies = [ "tungstenite", ] -[[package]] -name = "asynchronous-codec" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4057f2c32adbb2fc158e22fb38433c8e9bbf76b75a4732c7c0cbaf695fb65568" -dependencies = [ - "bytes", - "futures-sink", - "futures-util", - "memchr", - "pin-project-lite 0.2.15", -] - [[package]] name = "asynchronous-codec" version = "0.7.0" @@ -964,6 +951,15 @@ dependencies = [ "tower-service", ] +[[package]] +name = "backon" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5289ec98f68f28dd809fd601059e6aa908bb8f6108620930828283d4ee23d7" +dependencies = [ + "fastrand 2.3.0", +] + [[package]] name = "backtrace" version = "0.3.74" @@ -1020,9 +1016,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.70.1" +version = "0.71.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +checksum = "5f58bf3d7db68cfbac37cfc485a8d711e87e064c3d0fe0435b92f7a407f9d6b3" dependencies = [ "bitflags 2.6.0", "cexpr", @@ -1033,7 +1029,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "rustc-hash 1.1.0", + "rustc-hash", "shlex", "syn 2.0.90", ] @@ -1115,7 +1111,7 @@ dependencies = [ "async-channel 2.3.1", "async-task", "futures-io", - "futures-lite 2.4.0", + "futures-lite 2.5.0", "piper", ] @@ -1182,9 +1178,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -1200,9 +1196,9 @@ dependencies = [ [[package]] name = "capnpc" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d13cb6e2643fd1f9fb804ba938323636ef52e07d6e495e372d933ad0cb98207" +checksum = "1aa3d5f01e69ed11656d2c7c47bf34327ea9bfb5c85c7de787fcd7b6c5e45b61" dependencies = [ "capnp", ] @@ -1218,9 +1214,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.36" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ "shlex", ] @@ -1301,10 +1297,10 @@ dependencies = [ "rcgen 0.13.1", "redis", "rkyv", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pki-types", "sqlx", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tokio-rustls", "tracing", @@ -1335,9 +1331,9 @@ checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1368,9 +1364,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.22" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69371e34337c4c984bbe322360c2547210bf632eb2814bbe78a6e87a2935bd2b" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -1378,9 +1374,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.22" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e24c1b4099818523236a8ca881d2b45db98dadfb4625cf6608c12069fcbbde1" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -1402,15 +1398,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "cmake" -version = "0.1.51" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" dependencies = [ "cc", ] @@ -1616,9 +1612,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -2169,12 +2165,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2207,9 +2203,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" dependencies = [ "event-listener 5.3.1", "pin-project-lite 0.2.15", @@ -2226,9 +2222,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fiat-crypto" @@ -2250,9 +2246,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -2398,11 +2394,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f1fa2f9765705486b33fd2acf1577f8ec449c2ba1f318ae5447697b7c08d210" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ - "fastrand 2.1.1", + "fastrand 2.3.0", "futures-core", "futures-io", "parking", @@ -2427,7 +2423,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pki-types", ] @@ -2507,8 +2503,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -2557,7 +2555,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -2566,17 +2564,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.6.0", + "http 1.2.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -2613,9 +2611,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", @@ -2715,9 +2713,9 @@ checksum = "b07f60793ff0a4d9cef0f18e63b5357e06209987153a64648c972c1e5aff336f" [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "447afdcdb8afb9d0a852af6dc65d9b285ce720ed7a59e42a8bf2e931c67bc1b5" dependencies = [ "async-trait", "cfg-if", @@ -2726,12 +2724,12 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna 0.4.0", + "idna", "ipnet", "once_cell", "rand 0.8.5", - "socket2 0.5.7", - "thiserror 1.0.68", + "socket2 0.5.8", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -2740,9 +2738,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +checksum = "0a2e2aba9c389ce5267d31cf1e4dace82390ae276b0b364ea55630b1fa1b44b4" dependencies = [ "cfg-if", "futures-util", @@ -2754,7 +2752,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -2890,7 +2888,7 @@ dependencies = [ "hotshot-types", "serde", "tagged-base64", - "thiserror 2.0.4", + "thiserror 2.0.6", "tide-disco", "toml", "vbs", @@ -2913,7 +2911,7 @@ dependencies = [ "serde", "sha2 0.10.8", "sha3", - "thiserror 2.0.4", + "thiserror 2.0.6", "time 0.3.37", "tokio", "url", @@ -3031,7 +3029,7 @@ dependencies = [ "sha2 0.10.8", "surf-disco", "tagged-base64", - "thiserror 2.0.4", + "thiserror 2.0.6", "time 0.3.37", "tokio", "tracing", @@ -3072,7 +3070,7 @@ dependencies = [ "serde", "sha2 0.10.8", "tagged-base64", - "thiserror 2.0.4", + "thiserror 2.0.6", "tide-disco", "tokio", "tracing", @@ -3118,7 +3116,7 @@ dependencies = [ "serde_bytes", "sha2 0.10.8", "tagged-base64", - "thiserror 2.0.4", + "thiserror 2.0.6", "time 0.3.37", "tokio", "toml", @@ -3143,9 +3141,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -3170,7 +3168,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -3181,7 +3179,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "pin-project-lite 0.2.15", ] @@ -3255,7 +3253,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.15", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", "tower-service", "tracing", @@ -3264,15 +3262,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.7", + "http 1.2.0", "http-body 1.0.1", "httparse", "itoa", @@ -3289,10 +3287,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", - "http 1.1.0", - "hyper 1.5.0", + "http 1.2.0", + "hyper 1.5.1", "hyper-util", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pki-types", "tokio", "tokio-rustls", @@ -3319,7 +3317,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-util", "native-tls", "tokio", @@ -3336,11 +3334,11 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.5.1", "pin-project-lite 0.2.15", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", "tower-service", "tracing", @@ -3526,16 +3524,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -3569,19 +3557,23 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ - "async-io 2.3.4", + "async-io 2.4.0", "core-foundation", "fnv", "futures", "if-addrs", "ipnet", "log", + "netlink-packet-core", + "netlink-packet-route", + "netlink-proto", + "netlink-sys", "rtnetlink", - "system-configuration 0.5.1", + "system-configuration", "tokio", "windows", ] @@ -3625,13 +3617,13 @@ dependencies = [ [[package]] name = "impl-trait-for-tuples" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.90", ] [[package]] @@ -3666,12 +3658,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", "serde", ] @@ -3716,7 +3708,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.7", + "socket2 0.5.8", "widestring", "windows-sys 0.48.0", "winreg", @@ -3772,9 +3764,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jf-commitment" @@ -3977,10 +3969,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -4034,18 +4027,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.162" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -4056,16 +4049,15 @@ checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libp2p" -version = "0.53.2" +version = "0.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681fb3f183edfbedd7a57d32ebe5dcdc0b9f94061185acf3c30249349cc6fc99" +checksum = "bbbe80f9c7e00526cd6b838075b9c171919404a4732cb2fa8ece0a093223bfc4" dependencies = [ "bytes", "either", "futures", "futures-timer", "getrandom 0.2.15", - "instant", "libp2p-allow-block-list", "libp2p-autonat", "libp2p-connection-limits", @@ -4085,14 +4077,14 @@ dependencies = [ "multiaddr", "pin-project", "rw-stream-sink", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] name = "libp2p-allow-block-list" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "107b238b794cb83ab53b74ad5dcf7cca3200899b72fe662840cfb52f5b0a32e6" +checksum = "d1027ccf8d70320ed77e984f273bc8ce952f623762cb9bf2d126df73caef8041" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4102,30 +4094,36 @@ dependencies = [ [[package]] name = "libp2p-autonat" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95151726170e41b591735bf95c42b888fe4aa14f65216a9fbf0edcc04510586" +checksum = "a083675f189803d0682a2726131628e808144911dad076858bfbe30b13065499" dependencies = [ "async-trait", - "asynchronous-codec 0.6.2", + "asynchronous-codec", + "bytes", + "either", "futures", + "futures-bounded", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-request-response", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec 0.2.0", + "quick-protobuf-codec", "rand 0.8.5", + "rand_core 0.6.4", + "thiserror 1.0.69", "tracing", + "void", + "web-time", ] [[package]] name = "libp2p-connection-limits" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cd50a78ccfada14de94cbacd3ce4b0138157f376870f13d3a8422cd075b4fd" +checksum = "8d003540ee8baef0d254f7b6bfd79bac3ddf774662ca0abf69186d517ef82ad8" dependencies = [ "libp2p-core", "libp2p-identity", @@ -4135,9 +4133,9 @@ dependencies = [ [[package]] name = "libp2p-core" -version = "0.41.3" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5a8920cbd8540059a01950c1e5c96ea8d89eb50c51cd366fc18bdf540a6e48f" +checksum = "a61f26c83ed111104cd820fe9bc3aaabbac5f1652a1d213ed6e900b7918a1298" dependencies = [ "either", "fnv", @@ -4155,7 +4153,7 @@ dependencies = [ "rw-stream-sink", "serde", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "unsigned-varint 0.8.0", "void", @@ -4164,9 +4162,9 @@ dependencies = [ [[package]] name = "libp2p-dns" -version = "0.41.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d17cbcf7160ff35c3e8e560de4a068fe9d6cb777ea72840e48eb76ff9576c4b6" +checksum = "97f37f30d5c7275db282ecd86e54f29dd2176bd3ac656f06abf43bedb21eb8bd" dependencies = [ "async-trait", "futures", @@ -4180,12 +4178,12 @@ dependencies = [ [[package]] name = "libp2p-gossipsub" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d665144a616dadebdc5fff186b1233488cdcd8bfb1223218ff084b6d052c94f7" +checksum = "b4e830fdf24ac8c444c12415903174d506e1e077fbe3875c404a78c5935a8543" dependencies = [ - "asynchronous-codec 0.7.0", - "base64 0.21.7", + "asynchronous-codec", + "base64 0.22.1", "byteorder", "bytes", "either", @@ -4194,13 +4192,12 @@ dependencies = [ "futures-ticker", "getrandom 0.2.15", "hex_fmt", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", "prometheus-client", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand 0.8.5", "regex", "serde", @@ -4208,15 +4205,16 @@ dependencies = [ "smallvec", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-identify" -version = "0.44.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5d635ebea5ca0c3c3e77d414ae9b67eccf2a822be06091b9c1a0d13029a1e2f" +checksum = "1711b004a273be4f30202778856368683bd9a83c4c7dcc8f848847606831a4e3" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "either", "futures", "futures-bounded", @@ -4226,9 +4224,9 @@ dependencies = [ "libp2p-swarm", "lru 0.12.5", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "void", ] @@ -4249,46 +4247,46 @@ dependencies = [ "rand 0.8.5", "serde", "sha2 0.10.8", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "zeroize", ] [[package]] name = "libp2p-kad" -version = "0.45.3" +version = "0.46.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" +checksum = "ced237d0bd84bbebb7c2cad4c073160dacb4fe40534963c32ed6d4c6bb7702a3" dependencies = [ "arrayvec", - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "either", "fnv", "futures", "futures-bounded", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", "quick-protobuf", - "quick-protobuf-codec 0.3.1", + "quick-protobuf-codec", "rand 0.8.5", "serde", "sha2 0.10.8", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "uint", "void", + "web-time", ] [[package]] name = "libp2p-mdns" -version = "0.45.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49007d9a339b3e1d7eeebc4d67c05dbf23d300b7d091193ec2d3f26802d7faf2" +checksum = "14b8546b6644032565eb29046b42744aee1e9f261ed99671b2c93fb140dba417" dependencies = [ "data-encoding", "futures", @@ -4299,7 +4297,7 @@ dependencies = [ "libp2p-swarm", "rand 0.8.5", "smallvec", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", "tracing", "void", @@ -4307,12 +4305,11 @@ dependencies = [ [[package]] name = "libp2p-metrics" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdac91ae4f291046a3b2660c039a2830c931f84df2ee227989af92f7692d3357" +checksum = "77ebafa94a717c8442d8db8d3ae5d1c6a15e30f2d347e0cd31d057ca72e42566" dependencies = [ "futures", - "instant", "libp2p-core", "libp2p-gossipsub", "libp2p-identify", @@ -4321,6 +4318,7 @@ dependencies = [ "libp2p-swarm", "pin-project", "prometheus-client", + "web-time", ] [[package]] @@ -4350,9 +4348,9 @@ dependencies = [ [[package]] name = "libp2p-quic" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67296ad4e092e23f92aea3d2bdb6f24eab79c0929ed816dfb460ea2f4567d2b" +checksum = "46352ac5cd040c70e88e7ff8257a2ae2f891a4076abad2c439584a31c15fd24e" dependencies = [ "bytes", "futures", @@ -4365,25 +4363,24 @@ dependencies = [ "quinn", "rand 0.8.5", "ring 0.17.8", - "rustls 0.23.18", - "socket2 0.5.7", - "thiserror 1.0.68", + "rustls 0.23.19", + "socket2 0.5.8", + "thiserror 1.0.69", "tokio", "tracing", ] [[package]] name = "libp2p-request-response" -version = "0.26.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c314fe28368da5e3a262553fb0ad575c1c8934c461e10de10265551478163836" +checksum = "1356c9e376a94a75ae830c42cdaea3d4fe1290ba409a22c809033d1b7dcab0a6" dependencies = [ "async-trait", "cbor4ii", "futures", "futures-bounded", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm", @@ -4392,19 +4389,19 @@ dependencies = [ "smallvec", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm" -version = "0.44.2" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80cae6cb75f89dbca53862f9ebe0b9f463aa7b302762fcfaafb9e51dcc9b0f7e" +checksum = "d7dd6741793d2c1fb2088f67f82cf07261f25272ebe3c0b0c311e0c6b50e851a" dependencies = [ "either", "fnv", "futures", "futures-timer", - "instant", "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", @@ -4416,13 +4413,14 @@ dependencies = [ "tokio", "tracing", "void", + "web-time", ] [[package]] name = "libp2p-swarm-derive" -version = "0.34.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5daceb9dd908417b6dfcfe8e94098bc4aac54500c282e78120b885dadc09b999" +checksum = "206e0aa0ebe004d778d79fb0966aa0de996c19894e2c0605ba2f8524dd4443d8" dependencies = [ "heck", "proc-macro2", @@ -4432,9 +4430,9 @@ dependencies = [ [[package]] name = "libp2p-tcp" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b2460fc2748919adff99ecbc1aab296e4579e41f374fb164149bd2c9e529d4c" +checksum = "ad964f312c59dcfcac840acd8c555de8403e295d39edf96f5240048b5fcaa314" dependencies = [ "futures", "futures-timer", @@ -4442,16 +4440,16 @@ dependencies = [ "libc", "libp2p-core", "libp2p-identity", - "socket2 0.5.7", + "socket2 0.5.8", "tokio", "tracing", ] [[package]] name = "libp2p-tls" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b7b831e55ce2aa6c354e6861a85fdd4dd0a2b97d5e276fabac0e4810a71776" +checksum = "47b23dddc2b9c355f73c1e36eb0c3ae86f7dc964a3715f0731cfad352db4d847" dependencies = [ "futures", "futures-rustls", @@ -4459,18 +4457,18 @@ dependencies = [ "libp2p-identity", "rcgen 0.11.3", "ring 0.17.8", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-webpki 0.101.7", - "thiserror 1.0.68", + "thiserror 1.0.69", "x509-parser", "yasna", ] [[package]] name = "libp2p-upnp" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccf04b0e3ff3de52d07d5fd6c3b061d0e7f908ffc683c32d9638caedce86fc8" +checksum = "01bf2d1b772bd3abca049214a3304615e6a36fa6ffc742bdd1ba774486200b8f" dependencies = [ "futures", "futures-timer", @@ -4571,9 +4569,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "local-ip-address" @@ -4583,7 +4581,7 @@ checksum = "3669cf5561f8d27e8fc84cc15e58350e70f557d4d65f70e3154e54cd2f8e1782" dependencies = [ "libc", "neli", - "thiserror 1.0.68", + "thiserror 1.0.69", "windows-sys 0.59.0", ] @@ -4621,7 +4619,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] @@ -4772,11 +4770,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", @@ -4820,9 +4817,9 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.2" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" +checksum = "6b430e7953c29dd6a09afc29ff0bb69c6e306329ee6794700aee27b76a1aea8d" dependencies = [ "core2", "serde", @@ -4887,21 +4884,20 @@ dependencies = [ [[package]] name = "netlink-packet-core" -version = "0.4.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" dependencies = [ "anyhow", "byteorder", - "libc", "netlink-packet-utils", ] [[package]] name = "netlink-packet-route" -version = "0.12.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -4920,29 +4916,29 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] name = "netlink-proto" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +checksum = "86b33524dc0968bfad349684447bfce6db937a9ac3332a1fe60c0c5a5ce63f21" dependencies = [ "bytes", "futures", "log", "netlink-packet-core", "netlink-sys", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", ] [[package]] name = "netlink-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ "bytes", "futures", @@ -4953,9 +4949,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -5188,14 +5184,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.7.0" +version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" +checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.90", + "syn 1.0.109", ] [[package]] @@ -5235,9 +5231,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pathdiff" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "pem" @@ -5266,20 +5262,20 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" dependencies = [ "memchr", - "thiserror 1.0.68", + "thiserror 2.0.6", "ucd-trie", ] [[package]] name = "pest_derive" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d214365f632b123a47fd913301e14c946c61d1c183ee245fa76eb752e59a02dd" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" dependencies = [ "pest", "pest_generator", @@ -5287,9 +5283,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb55586734301717aea2ac313f50b2eb8f60d2fc3dc01d190eefa2e625f60c4e" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" dependencies = [ "pest", "pest_meta", @@ -5300,9 +5296,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.14" +version = "2.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75da2a70cf4d9cb76833c990ac9cd3923c9a8905a8929789ce347c84564d03d" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" dependencies = [ "once_cell", "pest", @@ -5360,7 +5356,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand 2.1.1", + "fastrand 2.3.0", "futures-io", ] @@ -5417,7 +5413,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite 0.2.15", - "rustix 0.38.39", + "rustix 0.38.42", "tracing", "windows-sys 0.59.0", ] @@ -5538,7 +5534,7 @@ dependencies = [ "memchr", "parking_lot", "protobuf", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -5637,80 +5633,70 @@ dependencies = [ "byteorder", ] -[[package]] -name = "quick-protobuf-codec" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ededb1cd78531627244d51dd0c7139fbe736c7d57af0092a76f0ffb2f56e98" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", - "quick-protobuf", - "thiserror 1.0.68", - "unsigned-varint 0.7.2", -] - [[package]] name = "quick-protobuf-codec" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0580ab32b169745d7a39db2ba969226ca16738931be152a3209b409de2474" dependencies = [ - "asynchronous-codec 0.7.0", + "asynchronous-codec", "bytes", "quick-protobuf", - "thiserror 1.0.68", + "thiserror 1.0.69", "unsigned-varint 0.8.0", ] [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "futures-io", "pin-project-lite 0.2.15", "quinn-proto", "quinn-udp", - "rustc-hash 2.0.0", - "rustls 0.23.18", - "socket2 0.5.7", - "thiserror 1.0.68", + "rustc-hash", + "rustls 0.23.19", + "socket2 0.5.8", + "thiserror 2.0.6", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom 0.2.15", "rand 0.8.5", "ring 0.17.8", - "rustc-hash 2.0.0", - "rustls 0.23.18", + "rustc-hash", + "rustls 0.23.19", + "rustls-pki-types", "slab", - "thiserror 1.0.68", + "thiserror 2.0.6", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" +checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" dependencies = [ "cfg_aliases", "libc", "once_cell", - "socket2 0.5.7", + "socket2 0.5.8", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5847,23 +5833,24 @@ dependencies = [ [[package]] name = "redis" -version = "0.27.5" +version = "0.27.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cccf17a692ce51b86564334614d72dcae1def0fd5ecebc9f02956da74352b5" +checksum = "09d8f99a4090c89cc489a94833c901ead69bfbf3877b4867d5482e321ee875bc" dependencies = [ "arc-swap", "async-trait", + "backon", "bytes", "combine", "futures", "futures-util", + "itertools 0.13.0", "itoa", "num-bigint", "percent-encoding", "pin-project-lite 0.2.15", "ryu", "tokio", - "tokio-retry2", "tokio-util", "url", ] @@ -5885,7 +5872,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -5896,7 +5883,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -5911,9 +5898,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -5952,11 +5939,11 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.7", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-rustls", "hyper-tls", "hyper-util", @@ -5972,8 +5959,8 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper 1.0.1", - "system-configuration 0.6.1", + "sync_wrapper 1.0.2", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -6083,9 +6070,9 @@ dependencies = [ [[package]] name = "rsa" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +checksum = "47c75d7c5c6b673e58bf54d8544a9f432e3a925b0e80f7cd3602ab5c50c55519" dependencies = [ "const-oid", "digest 0.10.7", @@ -6103,16 +6090,19 @@ dependencies = [ [[package]] name = "rtnetlink" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +checksum = "7a552eb82d19f38c3beed3f786bd23aa434ceb9ac43ab44419ca6d67a7e186c0" dependencies = [ "futures", "log", + "netlink-packet-core", "netlink-packet-route", + "netlink-packet-utils", "netlink-proto", + "netlink-sys", "nix", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", ] @@ -6134,15 +6124,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc-hex" @@ -6193,15 +6177,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.39" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6219,9 +6203,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.18" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "log", "once_cell", @@ -6246,6 +6230,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -6293,9 +6280,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -6343,9 +6330,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -6374,9 +6361,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -6392,9 +6379,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -6430,7 +6417,7 @@ checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" dependencies = [ "percent-encoding", "serde", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -6464,7 +6451,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_derive", "serde_json", @@ -6699,9 +6686,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -6776,7 +6763,7 @@ dependencies = [ "hashbrown 0.14.5", "hashlink 0.9.1", "hex", - "indexmap 2.6.0", + "indexmap 2.7.0", "log", "memchr", "once_cell", @@ -6787,7 +6774,7 @@ dependencies = [ "sha2 0.10.8", "smallvec", "sqlformat", - "thiserror 1.0.68", + "thiserror 1.0.69", "time 0.3.37", "tokio", "tokio-stream", @@ -6871,7 +6858,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.68", + "thiserror 1.0.69", "time 0.3.37", "tracing", "whoami", @@ -6910,7 +6897,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 1.0.68", + "thiserror 1.0.69", "time 0.3.37", "tracing", "whoami", @@ -7179,9 +7166,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] @@ -7197,17 +7184,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "system-configuration" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys 0.5.0", -] - [[package]] name = "system-configuration" version = "0.6.1" @@ -7216,17 +7192,7 @@ checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", "core-foundation", - "system-configuration-sys 0.6.0", -] - -[[package]] -name = "system-configuration-sys" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", + "system-configuration-sys", ] [[package]] @@ -7273,40 +7239,40 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", - "fastrand 2.1.1", + "fastrand 2.3.0", "once_cell", - "rustix 0.38.39", + "rustix 0.38.42", "windows-sys 0.59.0", ] [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.68", + "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ - "thiserror-impl 2.0.4", + "thiserror-impl 2.0.6", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -7315,9 +7281,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" dependencies = [ "proc-macro2", "quote", @@ -7383,7 +7349,7 @@ dependencies = [ "edit-distance", "futures", "futures-util", - "http 1.1.0", + "http 1.2.0", "include_dir", "itertools 0.12.1", "lazy_static", @@ -7552,7 +7518,7 @@ dependencies = [ "mio", "parking_lot", "pin-project-lite 0.2.15", - "socket2 0.5.7", + "socket2 0.5.8", "tokio-macros", "tracing", "windows-sys 0.52.0", @@ -7589,33 +7555,21 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-retry2" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "903934dba1c4c2f2e9cb460ef10b5695e0b0ecad3bf9ee7c8675e540c5e8b2d1" -dependencies = [ - "pin-project", - "rand 0.8.5", - "tokio", -] - [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.18", - "rustls-pki-types", + "rustls 0.23.19", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite 0.2.15", @@ -7624,9 +7578,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -7662,7 +7616,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -7856,7 +7810,7 @@ dependencies = [ "native-tls", "rand 0.8.5", "sha-1", - "thiserror 1.0.68", + "thiserror 1.0.69", "url", "utf-8", ] @@ -7905,9 +7859,9 @@ checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -7957,10 +7911,6 @@ name = "unsigned-varint" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6889a77d49f1f013504cec6bf97a2c730394adedaeb1deb5ea08949a50541105" -dependencies = [ - "asynchronous-codec 0.6.2", - "bytes", -] [[package]] name = "unsigned-varint" @@ -7982,18 +7932,18 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ "base64 0.22.1", "flate2", "log", "once_cell", - "rustls 0.23.18", + "rustls 0.23.19", "rustls-pki-types", "url", - "webpki-roots 0.26.6", + "webpki-roots 0.26.7", ] [[package]] @@ -8003,7 +7953,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", "serde", ] @@ -8188,9 +8138,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -8201,13 +8151,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn 2.0.90", @@ -8216,21 +8165,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8238,9 +8188,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -8251,15 +8201,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -8296,9 +8246,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] @@ -8343,29 +8293,30 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", + "windows-core 0.53.0", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] name = "windows-core" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ + "windows-result 0.1.2", "windows-targets 0.52.6", ] @@ -8375,11 +8326,20 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-strings", "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-result" version = "0.2.0" @@ -8395,7 +8355,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-targets 0.52.6", ] @@ -8601,15 +8561,15 @@ dependencies = [ "oid-registry", "ring 0.17.8", "rusticata-macros", - "thiserror 1.0.68", + "thiserror 1.0.69", "time 0.3.37", ] [[package]] name = "xml-rs" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af310deaae937e48a26602b730250b4949e125f468f11e6990be3e5304ddd96f" +checksum = "ea8b391c9a790b496184c29f7f93b9ed5b16abb306c05415b68bcc16e4d06432" [[package]] name = "xmltree" @@ -8642,9 +8602,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -8654,9 +8614,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", @@ -8687,18 +8647,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 4deaac0398..53780e32fc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ jf-utils = { version = "0.4.4", git = "https://github.com/espressosystems/jellyf lazy_static = "1" libp2p-identity = "0.2" libp2p-networking = { path = "./crates/libp2p-networking", version = "0.5", default-features = false } -libp2p-swarm-derive = { version = "0.34" } +libp2p-swarm-derive = { version = "0.35" } lru = "0.12" multiaddr = { version = "0.18" } portpicker = "0.1" @@ -91,7 +91,7 @@ vec1 = { version = "1", features = ["serde"] } reqwest = { version = "0.12", features = ["json"] } parking_lot = "0.12" -libp2p = { package = "libp2p", version = "0.53", default-features = false, features = [ +libp2p = { package = "libp2p", version = "0.54", default-features = false, features = [ "macros", "autonat", "cbor", diff --git a/audits/README.md b/audits/README.md index 49e3c6039c..1df2944f3b 100644 --- a/audits/README.md +++ b/audits/README.md @@ -5,4 +5,4 @@ Internal audits | Scope & Delivery date | Report | |-----------------------------|---------------------------------------------------------------| -| HotShot - July 29, 2024 | [Report](./internal-reviews/EspressoHotShot-2024internal.pdf) | \ No newline at end of file +| HotShot - July 29, 2024 | [Report](./internal-reviews/EspressoHotshot-2024internal.pdf) | diff --git a/crates/builder-api/src/v0_1/builder.rs b/crates/builder-api/src/v0_1/builder.rs index 399093908c..068d9f6e0a 100644 --- a/crates/builder-api/src/v0_1/builder.rs +++ b/crates/builder-api/src/v0_1/builder.rs @@ -262,8 +262,7 @@ where .body_auto::<::Transaction, Ver>(Ver::instance()) .map_err(Error::TxnUnpack)?; let hash = tx.commit(); - state.txn_status(hash).await.map_err(Error::TxnStat)?; - Ok(hash) + state.txn_status(hash).await.map_err(Error::TxnStat) } .boxed() })?; diff --git a/crates/example-types/src/storage_types.rs b/crates/example-types/src/storage_types.rs index acedb42007..1a666c737e 100644 --- a/crates/example-types/src/storage_types.rs +++ b/crates/example-types/src/storage_types.rs @@ -14,7 +14,9 @@ use async_lock::RwLock; use async_trait::async_trait; use hotshot_types::{ consensus::CommitmentMap, - data::{DaProposal, Leaf, Leaf2, QuorumProposal, QuorumProposal2, VidDisperseShare}, + data::{ + DaProposal, DaProposal2, Leaf, Leaf2, QuorumProposal, QuorumProposal2, VidDisperseShare, + }, event::HotShotAction, message::Proposal, simple_certificate::{QuorumCertificate2, UpgradeCertificate}, @@ -38,6 +40,7 @@ type VidShares = HashMap< pub struct TestStorageState { vids: VidShares, das: HashMap>>, + da2s: HashMap>>, proposals: BTreeMap>>, proposals2: BTreeMap>>, high_qc: Option>, @@ -51,6 +54,7 @@ impl Default for TestStorageState { Self { vids: HashMap::new(), das: HashMap::new(), + da2s: HashMap::new(), proposals: BTreeMap::new(), proposals2: BTreeMap::new(), high_qc: None, @@ -142,6 +146,21 @@ impl Storage for TestStorage { .insert(proposal.data.view_number, proposal.clone()); Ok(()) } + async fn append_da2( + &self, + proposal: &Proposal>, + _vid_commit: ::Commit, + ) -> Result<()> { + if self.should_return_err { + bail!("Failed to append VID proposal to storage"); + } + Self::run_delay_settings_from_config(&self.delay_config).await; + let mut inner = self.inner.write().await; + inner + .da2s + .insert(proposal.data.view_number, proposal.clone()); + Ok(()) + } async fn append_proposal( &self, proposal: &Proposal>, diff --git a/crates/libp2p-networking/src/network/node.rs b/crates/libp2p-networking/src/network/node.rs index ac223e2a51..5ae9cad238 100644 --- a/crates/libp2p-networking/src/network/node.rs +++ b/crates/libp2p-networking/src/network/node.rs @@ -217,7 +217,7 @@ impl NetworkNode { let identify = IdentifyBehaviour::new(identify_cfg); // Configure the Kademlia behaviour - let mut kconfig = Config::default(); + let mut kconfig = Config::new(StreamProtocol::new("/ipfs/kad/1.0.0")); kconfig .set_parallelism(NonZeroUsize::new(5).unwrap()) .set_provider_publication_interval(config.kademlia_config.publication_interval) @@ -584,6 +584,7 @@ impl NetworkNode { agent_version: _, observed_addr: _, }, + connection_id: _, } = *e { let behaviour = self.swarm.behaviour_mut(); diff --git a/crates/libp2p-networking/src/network/transport.rs b/crates/libp2p-networking/src/network/transport.rs index 0f3bdf80a9..aac8a66b60 100644 --- a/crates/libp2p-networking/src/network/transport.rs +++ b/crates/libp2p-networking/src/network/transport.rs @@ -14,7 +14,11 @@ use hotshot_types::traits::{ signature_key::SignatureKey, }; use libp2p::{ - core::{muxing::StreamMuxerExt, transport::TransportEvent, StreamMuxer}, + core::{ + muxing::StreamMuxerExt, + transport::{DialOpts, TransportEvent}, + StreamMuxer, + }, identity::PeerId, Transport, }; @@ -314,9 +318,10 @@ where fn dial( &mut self, addr: libp2p::Multiaddr, + opts: DialOpts, ) -> Result> { // Perform the inner dial - let res = self.inner.dial(addr); + let res = self.inner.dial(addr, opts); // Clone the necessary fields let auth_message = Arc::clone(&self.auth_message); @@ -329,27 +334,6 @@ where } } - /// Dial a remote peer as a listener. This function is changed to perform an authentication - /// handshake on top. The flow should be the reverse of the `dial` function and the - /// same as the `poll` function. - fn dial_as_listener( - &mut self, - addr: libp2p::Multiaddr, - ) -> Result> { - // Perform the inner dial - let res = self.inner.dial(addr); - - // Clone the necessary fields - let auth_message = Arc::clone(&self.auth_message); - let stake_table = Arc::clone(&self.stake_table); - - // If the dial was successful, perform the authentication handshake on top - match res { - Ok(dial) => Ok(Self::gen_handshake(dial, false, stake_table, auth_message)), - Err(err) => Err(err), - } - } - /// This function is where we perform the authentication handshake for _incoming_ connections. /// The flow in this case is the reverse of the `dial` function: we first verify the remote peer's /// authentication, and then authenticate with them. @@ -420,13 +404,6 @@ where fn remove_listener(&mut self, id: libp2p::core::transport::ListenerId) -> bool { self.inner.remove_listener(id) } - fn address_translation( - &self, - listen: &libp2p::Multiaddr, - observed: &libp2p::Multiaddr, - ) -> Option { - self.inner.address_translation(listen, observed) - } fn listen_on( &mut self, id: libp2p::core::transport::ListenerId, diff --git a/crates/macros/src/lib.rs b/crates/macros/src/lib.rs index 80f49e1d6a..c409cb6b58 100644 --- a/crates/macros/src/lib.rs +++ b/crates/macros/src/lib.rs @@ -27,7 +27,7 @@ struct TypePathBracketedArray { /// description of a crosstest #[derive(derive_builder::Builder, Debug, Clone)] struct CrossTestData { - /// imlementations + /// implementations impls: ExprArray, /// builder impl diff --git a/crates/task-impls/src/da.rs b/crates/task-impls/src/da.rs index f25d7012c2..d0bdfd6788 100644 --- a/crates/task-impls/src/da.rs +++ b/crates/task-impls/src/da.rs @@ -12,11 +12,11 @@ use async_trait::async_trait; use hotshot_task::task::TaskState; use hotshot_types::{ consensus::{Consensus, OuterConsensus}, - data::{DaProposal, PackedBundle}, + data::{DaProposal2, PackedBundle}, event::{Event, EventType}, message::{Proposal, UpgradeLock}, - simple_certificate::DaCertificate, - simple_vote::{DaData, DaVote}, + simple_certificate::DaCertificate2, + simple_vote::{DaData2, DaVote2}, traits::{ block_contents::vid_commitment, election::Membership, @@ -61,7 +61,7 @@ pub struct DaTaskState, V: Version pub network: Arc, /// A map of `DaVote` collector tasks. - pub vote_collectors: VoteCollectorsMap, DaCertificate, V>, + pub vote_collectors: VoteCollectorsMap, DaCertificate2, V>, /// This Nodes public key pub public_key: TYPES::SignatureKey, @@ -140,8 +140,11 @@ impl, V: Versions> DaTaskState { let cur_view = self.consensus.read().await.cur_view(); + let view_number = proposal.data.view_number(); + let epoch_number = proposal.data.epoch_number; + ensure!( - cur_view <= proposal.data.view_number() + 1, + cur_view <= view_number + 1, debug!( "Validated DA proposal for prior view but it's too old now Current view {:?}, DA Proposal view {:?}", cur_view, @@ -152,7 +155,7 @@ impl, V: Versions> DaTaskState, V: Versions> DaTaskState, V: Versions> DaTaskState, V: Versions> DaTaskState, V: Versions> DaTaskState = DaProposal { + let data: DaProposal2 = DaProposal2 { encoded_transactions: Arc::clone(encoded_transactions), metadata: metadata.clone(), // Upon entering a new view we want to send a DA Proposal for the next view -> Is it always the case that this is cur_view + 1? view_number, + epoch_number: *epoch_number, }; let message = Proposal { diff --git a/crates/task-impls/src/events.rs b/crates/task-impls/src/events.rs index 721a8b9cc0..c75ef7c752 100644 --- a/crates/task-impls/src/events.rs +++ b/crates/task-impls/src/events.rs @@ -11,18 +11,18 @@ use either::Either; use hotshot_task::task::TaskEvent; use hotshot_types::{ data::{ - DaProposal, Leaf2, PackedBundle, QuorumProposal2, UpgradeProposal, VidDisperse, + DaProposal2, Leaf2, PackedBundle, QuorumProposal2, UpgradeProposal, VidDisperse, VidDisperseShare, }, message::Proposal, request_response::ProposalRequestPayload, simple_certificate::{ - DaCertificate, QuorumCertificate, QuorumCertificate2, TimeoutCertificate, - UpgradeCertificate, ViewSyncCommitCertificate2, ViewSyncFinalizeCertificate2, - ViewSyncPreCommitCertificate2, + DaCertificate2, QuorumCertificate, QuorumCertificate2, TimeoutCertificate, + UpgradeCertificate, ViewSyncCommitCertificate, ViewSyncFinalizeCertificate, + ViewSyncPreCommitCertificate, }, simple_vote::{ - DaVote, QuorumVote2, TimeoutVote, UpgradeVote, ViewSyncCommitVote, ViewSyncFinalizeVote, + DaVote2, QuorumVote2, TimeoutVote, UpgradeVote, ViewSyncCommitVote, ViewSyncFinalizeVote, ViewSyncPreCommitVote, }, traits::{ @@ -80,15 +80,15 @@ pub enum HotShotEvent { /// Send a timeout vote to the network; emitted by consensus task replicas TimeoutVoteSend(TimeoutVote), /// A DA proposal has been received from the network; handled by the DA task - DaProposalRecv(Proposal>, TYPES::SignatureKey), + DaProposalRecv(Proposal>, TYPES::SignatureKey), /// A DA proposal has been validated; handled by the DA task and VID task - DaProposalValidated(Proposal>, TYPES::SignatureKey), + DaProposalValidated(Proposal>, TYPES::SignatureKey), /// A DA vote has been received by the network; handled by the DA task - DaVoteRecv(DaVote), + DaVoteRecv(DaVote2), /// A Data Availability Certificate (DAC) has been received by the network; handled by the consensus task - DaCertificateRecv(DaCertificate), + DaCertificateRecv(DaCertificate2), /// A DAC is validated. - DaCertificateValidated(DaCertificate), + DaCertificateValidated(DaCertificate2), /// Send a quorum proposal to the network; emitted by the leader in the consensus task QuorumProposalSend(Proposal>, TYPES::SignatureKey), /// Send a quorum vote to the next leader; emitted by a replica in the consensus task after seeing a valid quorum proposal @@ -117,15 +117,15 @@ pub enum HotShotEvent { /// A quorum proposal was requested by a node for a view. QuorumProposalResponseRecv(Proposal>), /// Send a DA proposal to the DA committee; emitted by the DA leader (which is the same node as the leader of view v + 1) in the DA task - DaProposalSend(Proposal>, TYPES::SignatureKey), + DaProposalSend(Proposal>, TYPES::SignatureKey), /// Send a DA vote to the DA leader; emitted by DA committee members in the DA task after seeing a valid DA proposal - DaVoteSend(DaVote), + DaVoteSend(DaVote2), /// The next leader has collected enough votes to form a QC; emitted by the next leader in the consensus task; an internal event only QcFormed(Either, TimeoutCertificate>), /// The next leader has collected enough votes to form a QC; emitted by the next leader in the consensus task; an internal event only Qc2Formed(Either, TimeoutCertificate>), /// The DA leader has collected enough votes to form a DAC; emitted by the DA leader in the DA task; sent to the entire network via the networking task - DacSend(DaCertificate, TYPES::SignatureKey), + DacSend(DaCertificate2, TYPES::SignatureKey), /// The current view has changed; emitted by the replica in the consensus task or replica in the view sync task; received by almost all other tasks ViewChange(TYPES::View, TYPES::Epoch), /// Timeout for the view sync protocol; emitted by a replica in the view sync task @@ -145,19 +145,19 @@ pub enum HotShotEvent { /// Send a `ViewSyncFinalizeVote` from the network; emitted by a replica in the view sync task ViewSyncFinalizeVoteSend(ViewSyncFinalizeVote), - /// Receive a `ViewSyncPreCommitCertificate2` from the network; received by a replica in the view sync task - ViewSyncPreCommitCertificate2Recv(ViewSyncPreCommitCertificate2), - /// Receive a `ViewSyncCommitCertificate2` from the network; received by a replica in the view sync task - ViewSyncCommitCertificate2Recv(ViewSyncCommitCertificate2), - /// Receive a `ViewSyncFinalizeCertificate2` from the network; received by a replica in the view sync task - ViewSyncFinalizeCertificate2Recv(ViewSyncFinalizeCertificate2), + /// Receive a `ViewSyncPreCommitCertificate` from the network; received by a replica in the view sync task + ViewSyncPreCommitCertificateRecv(ViewSyncPreCommitCertificate), + /// Receive a `ViewSyncCommitCertificate` from the network; received by a replica in the view sync task + ViewSyncCommitCertificateRecv(ViewSyncCommitCertificate), + /// Receive a `ViewSyncFinalizeCertificate` from the network; received by a replica in the view sync task + ViewSyncFinalizeCertificateRecv(ViewSyncFinalizeCertificate), - /// Send a `ViewSyncPreCommitCertificate2` from the network; emitted by a relay in the view sync task - ViewSyncPreCommitCertificate2Send(ViewSyncPreCommitCertificate2, TYPES::SignatureKey), - /// Send a `ViewSyncCommitCertificate2` from the network; emitted by a relay in the view sync task - ViewSyncCommitCertificate2Send(ViewSyncCommitCertificate2, TYPES::SignatureKey), - /// Send a `ViewSyncFinalizeCertificate2` from the network; emitted by a relay in the view sync task - ViewSyncFinalizeCertificate2Send(ViewSyncFinalizeCertificate2, TYPES::SignatureKey), + /// Send a `ViewSyncPreCommitCertificate` from the network; emitted by a relay in the view sync task + ViewSyncPreCommitCertificateSend(ViewSyncPreCommitCertificate, TYPES::SignatureKey), + /// Send a `ViewSyncCommitCertificate` from the network; emitted by a relay in the view sync task + ViewSyncCommitCertificateSend(ViewSyncCommitCertificate, TYPES::SignatureKey), + /// Send a `ViewSyncFinalizeCertificate` from the network; emitted by a relay in the view sync task + ViewSyncFinalizeCertificateSend(ViewSyncFinalizeCertificate, TYPES::SignatureKey), /// Trigger the start of the view sync protocol; emitted by view sync task; internal trigger only ViewSyncTrigger(TYPES::View), @@ -289,12 +289,12 @@ impl HotShotEvent { | HotShotEvent::ViewSyncPreCommitVoteSend(vote) => Some(vote.view_number()), HotShotEvent::ViewSyncFinalizeVoteRecv(vote) | HotShotEvent::ViewSyncFinalizeVoteSend(vote) => Some(vote.view_number()), - HotShotEvent::ViewSyncPreCommitCertificate2Recv(cert) - | HotShotEvent::ViewSyncPreCommitCertificate2Send(cert, _) => Some(cert.view_number()), - HotShotEvent::ViewSyncCommitCertificate2Recv(cert) - | HotShotEvent::ViewSyncCommitCertificate2Send(cert, _) => Some(cert.view_number()), - HotShotEvent::ViewSyncFinalizeCertificate2Recv(cert) - | HotShotEvent::ViewSyncFinalizeCertificate2Send(cert, _) => Some(cert.view_number()), + HotShotEvent::ViewSyncPreCommitCertificateRecv(cert) + | HotShotEvent::ViewSyncPreCommitCertificateSend(cert, _) => Some(cert.view_number()), + HotShotEvent::ViewSyncCommitCertificateRecv(cert) + | HotShotEvent::ViewSyncCommitCertificateSend(cert, _) => Some(cert.view_number()), + HotShotEvent::ViewSyncFinalizeCertificateRecv(cert) + | HotShotEvent::ViewSyncFinalizeCertificateSend(cert, _) => Some(cert.view_number()), HotShotEvent::SendPayloadCommitmentAndMetadata(_, _, _, view_number, _, _) => { Some(*view_number) } @@ -451,45 +451,45 @@ impl Display for HotShotEvent { "ViewSyncFinalizeVoteSend(view_number={:?})", vote.view_number() ), - HotShotEvent::ViewSyncPreCommitCertificate2Recv(cert) => { + HotShotEvent::ViewSyncPreCommitCertificateRecv(cert) => { write!( f, - "ViewSyncPreCommitCertificate2Recv(view_number={:?})", + "ViewSyncPreCommitCertificateRecv(view_number={:?})", cert.view_number() ) } - HotShotEvent::ViewSyncCommitCertificate2Recv(cert) => { + HotShotEvent::ViewSyncCommitCertificateRecv(cert) => { write!( f, - "ViewSyncCommitCertificate2Recv(view_number={:?})", + "ViewSyncCommitCertificateRecv(view_number={:?})", cert.view_number() ) } - HotShotEvent::ViewSyncFinalizeCertificate2Recv(cert) => { + HotShotEvent::ViewSyncFinalizeCertificateRecv(cert) => { write!( f, - "ViewSyncFinalizeCertificate2Recv(view_number={:?})", + "ViewSyncFinalizeCertificateRecv(view_number={:?})", cert.view_number() ) } - HotShotEvent::ViewSyncPreCommitCertificate2Send(cert, _) => { + HotShotEvent::ViewSyncPreCommitCertificateSend(cert, _) => { write!( f, - "ViewSyncPreCommitCertificate2Send(view_number={:?})", + "ViewSyncPreCommitCertificateSend(view_number={:?})", cert.view_number() ) } - HotShotEvent::ViewSyncCommitCertificate2Send(cert, _) => { + HotShotEvent::ViewSyncCommitCertificateSend(cert, _) => { write!( f, - "ViewSyncCommitCertificate2Send(view_number={:?})", + "ViewSyncCommitCertificateSend(view_number={:?})", cert.view_number() ) } - HotShotEvent::ViewSyncFinalizeCertificate2Send(cert, _) => { + HotShotEvent::ViewSyncFinalizeCertificateSend(cert, _) => { write!( f, - "ViewSyncFinalizeCertificate2Send(view_number={:?})", + "ViewSyncFinalizeCertificateSend(view_number={:?})", cert.view_number() ) } diff --git a/crates/task-impls/src/network.rs b/crates/task-impls/src/network.rs index ad9dcd4168..b885e2f7e5 100644 --- a/crates/task-impls/src/network.rs +++ b/crates/task-impls/src/network.rs @@ -36,6 +36,7 @@ use hotshot_types::{ use tokio::{spawn, task::JoinHandle}; use tracing::instrument; use utils::anytrace::*; +use vbs::version::StaticVersionType; use crate::{ events::{HotShotEvent, HotShotTaskCompleted}, @@ -88,22 +89,20 @@ impl NetworkMessageTaskState { } GeneralConsensusMessage::ViewSyncPreCommitCertificate( view_sync_message, - ) => HotShotEvent::ViewSyncPreCommitCertificate2Recv(view_sync_message), + ) => HotShotEvent::ViewSyncPreCommitCertificateRecv(view_sync_message), GeneralConsensusMessage::ViewSyncCommitVote(view_sync_message) => { HotShotEvent::ViewSyncCommitVoteRecv(view_sync_message) } GeneralConsensusMessage::ViewSyncCommitCertificate(view_sync_message) => { - HotShotEvent::ViewSyncCommitCertificate2Recv(view_sync_message) + HotShotEvent::ViewSyncCommitCertificateRecv(view_sync_message) } - GeneralConsensusMessage::ViewSyncFinalizeVote(view_sync_message) => { HotShotEvent::ViewSyncFinalizeVoteRecv(view_sync_message) } GeneralConsensusMessage::ViewSyncFinalizeCertificate(view_sync_message) => { - HotShotEvent::ViewSyncFinalizeCertificate2Recv(view_sync_message) + HotShotEvent::ViewSyncFinalizeCertificateRecv(view_sync_message) } - GeneralConsensusMessage::TimeoutVote(message) => { HotShotEvent::TimeoutVoteRecv(message) } @@ -115,18 +114,34 @@ impl NetworkMessageTaskState { HotShotEvent::UpgradeVoteRecv(message) } GeneralConsensusMessage::HighQc(qc) => HotShotEvent::HighQcRecv(qc, sender), + GeneralConsensusMessage::Proposal2(proposal) => { + HotShotEvent::QuorumProposalRecv(proposal, sender) + } + GeneralConsensusMessage::Vote2(vote) => HotShotEvent::QuorumVoteRecv(vote), + GeneralConsensusMessage::Proposal2Response(proposal) => { + HotShotEvent::QuorumProposalResponseRecv(proposal) + } }, SequencingMessage::Da(da_message) => match da_message { DaConsensusMessage::DaProposal(proposal) => { - HotShotEvent::DaProposalRecv(proposal, sender) + HotShotEvent::DaProposalRecv(convert_proposal(proposal), sender) + } + DaConsensusMessage::DaVote(vote) => { + HotShotEvent::DaVoteRecv(vote.clone().to_vote2()) } - DaConsensusMessage::DaVote(vote) => HotShotEvent::DaVoteRecv(vote.clone()), DaConsensusMessage::DaCertificate(cert) => { - HotShotEvent::DaCertificateRecv(cert) + HotShotEvent::DaCertificateRecv(cert.to_dac2()) } DaConsensusMessage::VidDisperseMsg(proposal) => { HotShotEvent::VidShareRecv(sender, proposal) } + DaConsensusMessage::DaProposal2(proposal) => { + HotShotEvent::DaProposalRecv(proposal, sender) + } + DaConsensusMessage::DaVote2(vote) => HotShotEvent::DaVoteRecv(vote.clone()), + DaConsensusMessage::DaCertificate2(cert) => { + HotShotEvent::DaCertificateRecv(cert) + } }, }; broadcast_event(Arc::new(event), &self.internal_event_stream).await; @@ -374,13 +389,23 @@ impl< match event.as_ref().clone() { HotShotEvent::QuorumProposalSend(proposal, sender) => { *maybe_action = Some(HotShotAction::Propose); - Some(( - sender, + + let message = if self + .upgrade_lock + .version_infallible(proposal.data.view_number()) + .await + >= V::Epochs::VERSION + { + MessageKind::::from_consensus_message(SequencingMessage::General( + GeneralConsensusMessage::Proposal2(proposal), + )) + } else { MessageKind::::from_consensus_message(SequencingMessage::General( GeneralConsensusMessage::Proposal(convert_proposal(proposal)), - )), - TransmitType::Broadcast, - )) + )) + }; + + Some((sender, message, TransmitType::Broadcast)) } // ED Each network task is subscribed to all these message types. Need filters per network task @@ -399,23 +424,41 @@ impl< } }; - Some(( - vote.signing_key(), + let message = if self + .upgrade_lock + .version_infallible(vote.view_number()) + .await + >= V::Epochs::VERSION + { + MessageKind::::from_consensus_message(SequencingMessage::General( + GeneralConsensusMessage::Vote2(vote.clone()), + )) + } else { MessageKind::::from_consensus_message(SequencingMessage::General( GeneralConsensusMessage::Vote(vote.clone().to_vote()), - )), - TransmitType::Direct(leader), - )) + )) + }; + + Some((vote.signing_key(), message, TransmitType::Direct(leader))) } HotShotEvent::ExtendedQuorumVoteSend(vote) => { *maybe_action = Some(HotShotAction::Vote); - Some(( - vote.signing_key(), + let message = if self + .upgrade_lock + .version_infallible(vote.view_number()) + .await + >= V::Epochs::VERSION + { + MessageKind::::from_consensus_message(SequencingMessage::General( + GeneralConsensusMessage::Vote2(vote.clone()), + )) + } else { MessageKind::::from_consensus_message(SequencingMessage::General( GeneralConsensusMessage::Vote(vote.clone().to_vote()), - )), - TransmitType::Broadcast, - )) + )) + }; + + Some((vote.signing_key(), message, TransmitType::Broadcast)) } HotShotEvent::QuorumProposalRequestSend(req, signature) => Some(( req.key.clone(), @@ -437,13 +480,23 @@ impl< } HotShotEvent::DaProposalSend(proposal, sender) => { *maybe_action = Some(HotShotAction::DaPropose); - Some(( - sender, + + let message = if self + .upgrade_lock + .version_infallible(proposal.data.view_number()) + .await + >= V::Epochs::VERSION + { MessageKind::::from_consensus_message(SequencingMessage::Da( - DaConsensusMessage::DaProposal(proposal), - )), - TransmitType::DaCommitteeBroadcast, - )) + DaConsensusMessage::DaProposal2(proposal), + )) + } else { + MessageKind::::from_consensus_message(SequencingMessage::Da( + DaConsensusMessage::DaProposal(convert_proposal(proposal)), + )) + }; + + Some((sender, message, TransmitType::DaCommitteeBroadcast)) } HotShotEvent::DaVoteSend(vote) => { *maybe_action = Some(HotShotAction::DaVote); @@ -460,23 +513,38 @@ impl< } }; - Some(( - vote.signing_key(), + let message = if self.upgrade_lock.version_infallible(view_number).await + >= V::Epochs::VERSION + { MessageKind::::from_consensus_message(SequencingMessage::Da( - DaConsensusMessage::DaVote(vote.clone()), - )), - TransmitType::Direct(leader), - )) + DaConsensusMessage::DaVote2(vote.clone()), + )) + } else { + MessageKind::::from_consensus_message(SequencingMessage::Da( + DaConsensusMessage::DaVote(vote.clone().to_vote()), + )) + }; + + Some((vote.signing_key(), message, TransmitType::Direct(leader))) } HotShotEvent::DacSend(certificate, sender) => { *maybe_action = Some(HotShotAction::DaCert); - Some(( - sender, + let message = if self + .upgrade_lock + .version_infallible(certificate.view_number()) + .await + >= V::Epochs::VERSION + { MessageKind::::from_consensus_message(SequencingMessage::Da( - DaConsensusMessage::DaCertificate(certificate), - )), - TransmitType::Broadcast, - )) + DaConsensusMessage::DaCertificate2(certificate), + )) + } else { + MessageKind::::from_consensus_message(SequencingMessage::Da( + DaConsensusMessage::DaCertificate(certificate.to_dac()), + )) + }; + + Some((sender, message, TransmitType::Broadcast)) } HotShotEvent::ViewSyncPreCommitVoteSend(vote) => { let view_number = vote.view_number() + vote.date().relay; @@ -546,21 +614,21 @@ impl< TransmitType::Direct(leader), )) } - HotShotEvent::ViewSyncPreCommitCertificate2Send(certificate, sender) => Some(( + HotShotEvent::ViewSyncPreCommitCertificateSend(certificate, sender) => Some(( sender, MessageKind::::from_consensus_message(SequencingMessage::General( GeneralConsensusMessage::ViewSyncPreCommitCertificate(certificate), )), TransmitType::Broadcast, )), - HotShotEvent::ViewSyncCommitCertificate2Send(certificate, sender) => Some(( + HotShotEvent::ViewSyncCommitCertificateSend(certificate, sender) => Some(( sender, MessageKind::::from_consensus_message(SequencingMessage::General( GeneralConsensusMessage::ViewSyncCommitCertificate(certificate), )), TransmitType::Broadcast, )), - HotShotEvent::ViewSyncFinalizeCertificate2Send(certificate, sender) => Some(( + HotShotEvent::ViewSyncFinalizeCertificateSend(certificate, sender) => Some(( sender, MessageKind::::from_consensus_message(SequencingMessage::General( GeneralConsensusMessage::ViewSyncFinalizeCertificate(certificate), diff --git a/crates/task-impls/src/quorum_proposal/handlers.rs b/crates/task-impls/src/quorum_proposal/handlers.rs index d7bf08ecfd..2f2f604efb 100644 --- a/crates/task-impls/src/quorum_proposal/handlers.rs +++ b/crates/task-impls/src/quorum_proposal/handlers.rs @@ -20,7 +20,8 @@ use committable::Committable; use hotshot_task::dependency_task::HandleDepOutput; use hotshot_types::{ consensus::{CommitmentAndMetadata, OuterConsensus}, - data::{Leaf2, QuorumProposal, VidDisperse, ViewChangeEvidence}, + data::{Leaf2, QuorumProposal2, VidDisperse, ViewChangeEvidence}, + drb::{INITIAL_DRB_RESULT, INITIAL_DRB_SEED_INPUT}, message::Proposal, simple_certificate::{QuorumCertificate2, UpgradeCertificate}, traits::{ @@ -50,7 +51,7 @@ pub(crate) enum ProposalDependency { /// For the `Qc2Formed` event. Qc, - /// For the `ViewSyncFinalizeCertificate2Recv` event. + /// For the `ViewSyncFinalizeCertificateRecv` event. ViewSyncCert, /// For the `Qc2Formed` event timeout branch. @@ -293,14 +294,15 @@ impl ProposalDependencyHandle { .context(warn!("Failed to construct marketplace block header"))? }; - let proposal = QuorumProposal { + let proposal = QuorumProposal2 { block_header, view_number: self.view_number, - justify_qc: parent_qc.to_qc(), + justify_qc: parent_qc, upgrade_certificate, - proposal_certificate, - } - .into(); + view_change_evidence: proposal_certificate, + drb_seed: INITIAL_DRB_SEED_INPUT, + drb_result: INITIAL_DRB_RESULT, + }; let proposed_leaf = Leaf2::from_quorum_proposal(&proposal); ensure!( @@ -373,7 +375,7 @@ impl HandleDepOutput for ProposalDependencyHandle< parent_qc = Some(qc.clone()); } }, - HotShotEvent::ViewSyncFinalizeCertificate2Recv(cert) => { + HotShotEvent::ViewSyncFinalizeCertificateRecv(cert) => { view_sync_finalize_cert = Some(cert.clone()); } HotShotEvent::VidDisperseSend(share, _) => { diff --git a/crates/task-impls/src/quorum_proposal/mod.rs b/crates/task-impls/src/quorum_proposal/mod.rs index aeb774ff17..00542ebd6b 100644 --- a/crates/task-impls/src/quorum_proposal/mod.rs +++ b/crates/task-impls/src/quorum_proposal/mod.rs @@ -114,8 +114,7 @@ impl, V: Versions> } } ProposalDependency::ViewSyncCert => { - if let HotShotEvent::ViewSyncFinalizeCertificate2Recv(view_sync_cert) = - event + if let HotShotEvent::ViewSyncFinalizeCertificateRecv(view_sync_cert) = event { view_sync_cert.view_number() } else { @@ -222,7 +221,7 @@ impl, V: Versions> qc_dependency.mark_as_completed(event); } }, - HotShotEvent::ViewSyncFinalizeCertificate2Recv(_) => { + HotShotEvent::ViewSyncFinalizeCertificateRecv(_) => { view_sync_dependency.mark_as_completed(event); } HotShotEvent::VidDisperseSend(_, _) => { @@ -433,7 +432,7 @@ impl, V: Versions> Arc::clone(&event), )?; } - HotShotEvent::ViewSyncFinalizeCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncFinalizeCertificateRecv(certificate) => { let epoch_number = self.consensus.read().await.cur_epoch(); ensure!( diff --git a/crates/task-impls/src/quorum_proposal_recv/handlers.rs b/crates/task-impls/src/quorum_proposal_recv/handlers.rs index 3d5c010058..528fc04562 100644 --- a/crates/task-impls/src/quorum_proposal_recv/handlers.rs +++ b/crates/task-impls/src/quorum_proposal_recv/handlers.rs @@ -156,10 +156,10 @@ pub(crate) async fn handle_quorum_proposal_recv< .is_valid_cert( validation_info .quorum_membership - .stake_table(validation_info.cur_epoch), + .stake_table(justify_qc.data.epoch), validation_info .quorum_membership - .success_threshold(validation_info.cur_epoch), + .success_threshold(justify_qc.data.epoch), &validation_info.upgrade_lock, ) .await diff --git a/crates/task-impls/src/quorum_vote/handlers.rs b/crates/task-impls/src/quorum_vote/handlers.rs index 3acba8300d..8410ecd19e 100644 --- a/crates/task-impls/src/quorum_vote/handlers.rs +++ b/crates/task-impls/src/quorum_vote/handlers.rs @@ -399,12 +399,17 @@ pub(crate) async fn submit_vote, V private_key: ::PrivateKey, upgrade_lock: UpgradeLock, view_number: TYPES::View, - epoch_number: TYPES::Epoch, + epoch_height: u64, storage: Arc>, leaf: Leaf2, vid_share: Proposal>, extended_vote: bool, ) -> Result<()> { + let epoch_number = TYPES::Epoch::new(epoch_from_block_number( + leaf.block_header().block_number(), + epoch_height, + )); + ensure!( quorum_membership.has_stake(&public_key, epoch_number), info!( @@ -417,6 +422,7 @@ pub(crate) async fn submit_vote, V let vote = QuorumVote2::::create_signed_vote( QuorumData2 { leaf_commit: leaf.commit(), + epoch: epoch_number, }, view_number, &public_key, diff --git a/crates/task-impls/src/quorum_vote/mod.rs b/crates/task-impls/src/quorum_vote/mod.rs index 1e29df5f81..16c6ecd583 100644 --- a/crates/task-impls/src/quorum_vote/mod.rs +++ b/crates/task-impls/src/quorum_vote/mod.rs @@ -235,7 +235,7 @@ impl + 'static, V: Versions> Handl self.private_key.clone(), self.upgrade_lock.clone(), self.view_number, - current_epoch, + self.epoch_height, Arc::clone(&self.storage), leaf, vid_share, @@ -707,7 +707,7 @@ impl, V: Versions> QuorumVoteTaskS self.private_key.clone(), self.upgrade_lock.clone(), proposal.data.view_number(), - current_epoch, + self.epoch_height, Arc::clone(&self.storage), proposed_leaf, updated_vid, diff --git a/crates/task-impls/src/transactions.rs b/crates/task-impls/src/transactions.rs index 6aa1ca6e75..07f47323ea 100644 --- a/crates/task-impls/src/transactions.rs +++ b/crates/task-impls/src/transactions.rs @@ -124,6 +124,7 @@ impl, V: Versions> TransactionTask &mut self, event_stream: &Sender>>, block_view: TYPES::View, + block_epoch: TYPES::Epoch, ) -> Option { let version = match self.upgrade_lock.version(block_view).await { Ok(v) => v, @@ -134,10 +135,10 @@ impl, V: Versions> TransactionTask }; if version < V::Marketplace::VERSION { - self.handle_view_change_legacy(event_stream, block_view) + self.handle_view_change_legacy(event_stream, block_view, block_epoch) .await } else { - self.handle_view_change_marketplace(event_stream, block_view) + self.handle_view_change_marketplace(event_stream, block_view, block_epoch) .await } } @@ -148,6 +149,7 @@ impl, V: Versions> TransactionTask &mut self, event_stream: &Sender>>, block_view: TYPES::View, + block_epoch: TYPES::Epoch, ) -> Option { let version = match self.upgrade_lock.version(block_view).await { Ok(v) => v, @@ -185,6 +187,7 @@ impl, V: Versions> TransactionTask block_payload.encode(), metadata, block_view, + block_epoch, vec1::vec1![fee], precompute_data, None, @@ -228,6 +231,7 @@ impl, V: Versions> TransactionTask vec![].into(), metadata, block_view, + block_epoch, vec1::vec1![null_fee], Some(precompute_data), None, @@ -248,6 +252,7 @@ impl, V: Versions> TransactionTask async fn produce_block_marketplace( &mut self, block_view: TYPES::View, + block_epoch: TYPES::Epoch, task_start_time: Instant, ) -> Result> { ensure!( @@ -340,6 +345,7 @@ impl, V: Versions> TransactionTask block_payload.encode(), metadata, block_view, + block_epoch, sequencing_fees, None, Some(auction_result), @@ -350,6 +356,7 @@ impl, V: Versions> TransactionTask pub fn null_block( &self, block_view: TYPES::View, + block_epoch: TYPES::Epoch, version: Version, ) -> Option> { let membership_total_nodes = self.membership.total_nodes(self.cur_epoch); @@ -371,6 +378,7 @@ impl, V: Versions> TransactionTask vec![].into(), metadata, block_view, + block_epoch, vec1::vec1![null_fee], Some(precompute_data), Some(TYPES::AuctionResult::default()), @@ -383,6 +391,7 @@ impl, V: Versions> TransactionTask &mut self, event_stream: &Sender>>, block_view: TYPES::View, + block_epoch: TYPES::Epoch, ) -> Option { let task_start_time = Instant::now(); @@ -395,7 +404,7 @@ impl, V: Versions> TransactionTask }; let packed_bundle = match self - .produce_block_marketplace(block_view, task_start_time) + .produce_block_marketplace(block_view, block_epoch, task_start_time) .await { Ok(b) => b, @@ -406,7 +415,7 @@ impl, V: Versions> TransactionTask e ); - let null_block = self.null_block(block_view, version)?; + let null_block = self.null_block(block_view, block_epoch, version)?; // Increment the metric for number of empty blocks proposed self.consensus @@ -435,12 +444,13 @@ impl, V: Versions> TransactionTask &mut self, event_stream: &Sender>>, block_view: TYPES::View, + block_epoch: TYPES::Epoch, ) -> Option { if self.consensus.read().await.is_high_qc_forming_eqc() { tracing::info!("Reached end of epoch. Not getting a new block until we form an eQC."); None } else { - self.handle_view_change_marketplace(event_stream, block_view) + self.handle_view_change_marketplace(event_stream, block_view, block_epoch) .await } } @@ -478,7 +488,7 @@ impl, V: Versions> TransactionTask ); self.cur_view = view; if self.membership.leader(view, self.cur_epoch)? == self.public_key { - self.handle_view_change(&event_stream, view).await; + self.handle_view_change(&event_stream, view, *epoch).await; return Ok(()); } } diff --git a/crates/task-impls/src/view_sync.rs b/crates/task-impls/src/view_sync.rs index 47ebe86444..3d702001f9 100644 --- a/crates/task-impls/src/view_sync.rs +++ b/crates/task-impls/src/view_sync.rs @@ -18,7 +18,7 @@ use hotshot_task::task::TaskState; use hotshot_types::{ message::{GeneralConsensusMessage, UpgradeLock}, simple_certificate::{ - ViewSyncCommitCertificate2, ViewSyncFinalizeCertificate2, ViewSyncPreCommitCertificate2, + ViewSyncCommitCertificate, ViewSyncFinalizeCertificate, ViewSyncPreCommitCertificate, }, simple_vote::{ ViewSyncCommitData, ViewSyncCommitVote, ViewSyncFinalizeData, ViewSyncFinalizeVote, @@ -89,17 +89,16 @@ pub struct ViewSyncTaskState { /// Map of pre-commit vote accumulates for the relay pub pre_commit_relay_map: RwLock< - RelayMap, ViewSyncPreCommitCertificate2, V>, + RelayMap, ViewSyncPreCommitCertificate, V>, >, /// Map of commit vote accumulates for the relay pub commit_relay_map: - RwLock, ViewSyncCommitCertificate2, V>>, + RwLock, ViewSyncCommitCertificate, V>>, /// Map of finalize vote accumulates for the relay - pub finalize_relay_map: RwLock< - RelayMap, ViewSyncFinalizeCertificate2, V>, - >, + pub finalize_relay_map: + RwLock, ViewSyncFinalizeCertificate, V>>, /// Timeout duration for view sync rounds pub view_sync_timeout: Duration, @@ -256,19 +255,19 @@ impl ViewSyncTaskState { event_stream: Sender>>, ) -> Result<()> { match event.as_ref() { - HotShotEvent::ViewSyncPreCommitCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncPreCommitCertificateRecv(certificate) => { tracing::debug!("Received view sync cert for phase {:?}", certificate); let view = certificate.view_number(); self.send_to_or_create_replica(event, view, &event_stream) .await; } - HotShotEvent::ViewSyncCommitCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncCommitCertificateRecv(certificate) => { tracing::debug!("Received view sync cert for phase {:?}", certificate); let view = certificate.view_number(); self.send_to_or_create_replica(event, view, &event_stream) .await; } - HotShotEvent::ViewSyncFinalizeCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncFinalizeCertificateRecv(certificate) => { tracing::debug!("Received view sync cert for phase {:?}", certificate); let view = certificate.view_number(); self.send_to_or_create_replica(event, view, &event_stream) @@ -511,7 +510,7 @@ impl ViewSyncReplicaTaskState { event_stream: Sender>>, ) -> Option { match event.as_ref() { - HotShotEvent::ViewSyncPreCommitCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncPreCommitCertificateRecv(certificate) => { let last_seen_certificate = ViewSyncPhase::PreCommit; // Ignore certificate if it is for an older round @@ -597,7 +596,7 @@ impl ViewSyncReplicaTaskState { })); } - HotShotEvent::ViewSyncCommitCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncCommitCertificateRecv(certificate) => { let last_seen_certificate = ViewSyncPhase::Commit; // Ignore certificate if it is for an older round @@ -696,7 +695,7 @@ impl ViewSyncReplicaTaskState { })); } - HotShotEvent::ViewSyncFinalizeCertificate2Recv(certificate) => { + HotShotEvent::ViewSyncFinalizeCertificateRecv(certificate) => { // Ignore certificate if it is for an older round if certificate.view_number() < self.next_view { tracing::warn!("We're already in a higher round"); diff --git a/crates/task-impls/src/vote_collection.rs b/crates/task-impls/src/vote_collection.rs index bca808ce50..ae52d94cec 100644 --- a/crates/task-impls/src/vote_collection.rs +++ b/crates/task-impls/src/vote_collection.rs @@ -17,12 +17,12 @@ use either::Either::{self, Left, Right}; use hotshot_types::{ message::UpgradeLock, simple_certificate::{ - DaCertificate, QuorumCertificate, QuorumCertificate2, TimeoutCertificate, - UpgradeCertificate, ViewSyncCommitCertificate2, ViewSyncFinalizeCertificate2, - ViewSyncPreCommitCertificate2, + DaCertificate2, QuorumCertificate, QuorumCertificate2, TimeoutCertificate, + UpgradeCertificate, ViewSyncCommitCertificate, ViewSyncFinalizeCertificate, + ViewSyncPreCommitCertificate, }, simple_vote::{ - DaVote, QuorumVote, QuorumVote2, TimeoutVote, UpgradeVote, ViewSyncCommitVote, + DaVote2, QuorumVote, QuorumVote2, TimeoutVote, UpgradeVote, ViewSyncCommitVote, ViewSyncFinalizeVote, ViewSyncPreCommitVote, }, traits::{ @@ -299,7 +299,8 @@ where type QuorumVoteState = VoteCollectionTaskState, QuorumCertificate2, V>; /// Alias for DA vote accumulator -type DaVoteState = VoteCollectionTaskState, DaCertificate, V>; +type DaVoteState = + VoteCollectionTaskState, DaCertificate2, V>; /// Alias for Timeout vote accumulator type TimeoutVoteState = VoteCollectionTaskState, TimeoutCertificate, V>; @@ -310,17 +311,17 @@ type UpgradeVoteState = type ViewSyncPreCommitState = VoteCollectionTaskState< TYPES, ViewSyncPreCommitVote, - ViewSyncPreCommitCertificate2, + ViewSyncPreCommitCertificate, V, >; /// Alias for View Sync Commit vote accumulator type ViewSyncCommitVoteState = - VoteCollectionTaskState, ViewSyncCommitCertificate2, V>; + VoteCollectionTaskState, ViewSyncCommitCertificate, V>; /// Alias for View Sync Finalize vote accumulator type ViewSyncFinalizeVoteState = VoteCollectionTaskState< TYPES, ViewSyncFinalizeVote, - ViewSyncFinalizeCertificate2, + ViewSyncFinalizeCertificate, V, >; @@ -378,8 +379,8 @@ impl AggregatableVote, UpgradeCertifi } } -impl AggregatableVote, DaCertificate> - for DaVote +impl AggregatableVote, DaCertificate2> + for DaVote2 { fn leader( &self, @@ -389,7 +390,7 @@ impl AggregatableVote, DaCertificate, + certificate: DaCertificate2, key: &TYPES::SignatureKey, ) -> HotShotEvent { HotShotEvent::DacSend(certificate, key.clone()) @@ -415,7 +416,7 @@ impl AggregatableVote, TimeoutCertifi } impl - AggregatableVote, ViewSyncCommitCertificate2> + AggregatableVote, ViewSyncCommitCertificate> for ViewSyncCommitVote { fn leader( @@ -426,15 +427,15 @@ impl membership.leader(self.date().round + self.date().relay, epoch) } fn make_cert_event( - certificate: ViewSyncCommitCertificate2, + certificate: ViewSyncCommitCertificate, key: &TYPES::SignatureKey, ) -> HotShotEvent { - HotShotEvent::ViewSyncCommitCertificate2Send(certificate, key.clone()) + HotShotEvent::ViewSyncCommitCertificateSend(certificate, key.clone()) } } impl - AggregatableVote, ViewSyncPreCommitCertificate2> + AggregatableVote, ViewSyncPreCommitCertificate> for ViewSyncPreCommitVote { fn leader( @@ -445,15 +446,15 @@ impl membership.leader(self.date().round + self.date().relay, epoch) } fn make_cert_event( - certificate: ViewSyncPreCommitCertificate2, + certificate: ViewSyncPreCommitCertificate, key: &TYPES::SignatureKey, ) -> HotShotEvent { - HotShotEvent::ViewSyncPreCommitCertificate2Send(certificate, key.clone()) + HotShotEvent::ViewSyncPreCommitCertificateSend(certificate, key.clone()) } } impl - AggregatableVote, ViewSyncFinalizeCertificate2> + AggregatableVote, ViewSyncFinalizeCertificate> for ViewSyncFinalizeVote { fn leader( @@ -464,10 +465,10 @@ impl membership.leader(self.date().round + self.date().relay, epoch) } fn make_cert_event( - certificate: ViewSyncFinalizeCertificate2, + certificate: ViewSyncFinalizeCertificate, key: &TYPES::SignatureKey, ) -> HotShotEvent { - HotShotEvent::ViewSyncFinalizeCertificate2Send(certificate, key.clone()) + HotShotEvent::ViewSyncFinalizeCertificateSend(certificate, key.clone()) } } @@ -514,14 +515,14 @@ impl } #[async_trait] -impl HandleVoteEvent, DaCertificate> +impl HandleVoteEvent, DaCertificate2> for DaVoteState { async fn handle_vote_event( &mut self, event: Arc>, sender: &Sender>>, - ) -> Result>> { + ) -> Result>> { match event.as_ref() { HotShotEvent::DaVoteRecv(vote) => self.accumulate_vote(vote, sender).await, _ => Ok(None), @@ -554,14 +555,14 @@ impl #[async_trait] impl - HandleVoteEvent, ViewSyncPreCommitCertificate2> + HandleVoteEvent, ViewSyncPreCommitCertificate> for ViewSyncPreCommitState { async fn handle_vote_event( &mut self, event: Arc>, sender: &Sender>>, - ) -> Result>> { + ) -> Result>> { match event.as_ref() { HotShotEvent::ViewSyncPreCommitVoteRecv(vote) => { self.accumulate_vote(vote, sender).await @@ -576,14 +577,14 @@ impl #[async_trait] impl - HandleVoteEvent, ViewSyncCommitCertificate2> + HandleVoteEvent, ViewSyncCommitCertificate> for ViewSyncCommitVoteState { async fn handle_vote_event( &mut self, event: Arc>, sender: &Sender>>, - ) -> Result>> { + ) -> Result>> { match event.as_ref() { HotShotEvent::ViewSyncCommitVoteRecv(vote) => self.accumulate_vote(vote, sender).await, _ => Ok(None), @@ -596,14 +597,14 @@ impl #[async_trait] impl - HandleVoteEvent, ViewSyncFinalizeCertificate2> + HandleVoteEvent, ViewSyncFinalizeCertificate> for ViewSyncFinalizeVoteState { async fn handle_vote_event( &mut self, event: Arc>, sender: &Sender>>, - ) -> Result>> { + ) -> Result>> { match event.as_ref() { HotShotEvent::ViewSyncFinalizeVoteRecv(vote) => { self.accumulate_vote(vote, sender).await diff --git a/crates/testing/src/block_builder/simple.rs b/crates/testing/src/block_builder/simple.rs index 8376633afc..e0af714f9a 100644 --- a/crates/testing/src/block_builder/simple.rs +++ b/crates/testing/src/block_builder/simple.rs @@ -238,7 +238,7 @@ where .await; if transactions.is_empty() { - // We don't want to return an empty block if we have no trasnactions, as we would end up + // We don't want to return an empty block if we have no transactions, as we would end up // driving consensus to produce empty blocks extremely quickly when mempool is empty. // Instead, we return no blocks, so that view leader will keep asking for blocks until // either we have something non-trivial to propose, or leader runs out of time to propose, diff --git a/crates/testing/src/helpers.rs b/crates/testing/src/helpers.rs index 9722e46c1d..67fa7a78c6 100644 --- a/crates/testing/src/helpers.rs +++ b/crates/testing/src/helpers.rs @@ -27,8 +27,8 @@ use hotshot_types::{ consensus::ConsensusMetricsValue, data::{Leaf, Leaf2, QuorumProposal, VidDisperse, VidDisperseShare}, message::{GeneralConsensusMessage, Proposal, UpgradeLock}, - simple_certificate::DaCertificate, - simple_vote::{DaData, DaVote, QuorumData, QuorumVote, SimpleVote, VersionedVoteData}, + simple_certificate::DaCertificate2, + simple_vote::{DaData2, DaVote2, QuorumData, QuorumVote, SimpleVote, VersionedVoteData}, traits::{ block_contents::vid_commitment, consensus_api::ConsensusApi, @@ -361,17 +361,18 @@ pub async fn build_da_certificate( public_key: &TYPES::SignatureKey, private_key: &::PrivateKey, upgrade_lock: &UpgradeLock, -) -> DaCertificate { +) -> DaCertificate2 { let encoded_transactions = TestTransaction::encode(&transactions); let da_payload_commitment = vid_commitment(&encoded_transactions, membership.total_nodes(epoch_number)); - let da_data = DaData { + let da_data = DaData2 { payload_commit: da_payload_commitment, + epoch: epoch_number, }; - build_cert::, DaCertificate>( + build_cert::, DaVote2, DaCertificate2>( da_data, membership, view_number, diff --git a/crates/testing/src/view_generator.rs b/crates/testing/src/view_generator.rs index a6651ad55d..e31f98364f 100644 --- a/crates/testing/src/view_generator.rs +++ b/crates/testing/src/view_generator.rs @@ -22,17 +22,17 @@ use hotshot_example_types::{ }; use hotshot_types::{ data::{ - DaProposal, EpochNumber, Leaf, Leaf2, QuorumProposal2, VidDisperse, VidDisperseShare, + DaProposal2, EpochNumber, Leaf, Leaf2, QuorumProposal2, VidDisperse, VidDisperseShare, ViewChangeEvidence, ViewNumber, }, drb::{INITIAL_DRB_RESULT, INITIAL_DRB_SEED_INPUT}, message::{Proposal, UpgradeLock}, simple_certificate::{ - DaCertificate, QuorumCertificate, QuorumCertificate2, TimeoutCertificate, - UpgradeCertificate, ViewSyncFinalizeCertificate2, + DaCertificate2, QuorumCertificate, QuorumCertificate2, TimeoutCertificate, + UpgradeCertificate, ViewSyncFinalizeCertificate, }, simple_vote::{ - DaData, DaVote, QuorumData2, QuorumVote2, TimeoutData, TimeoutVote, UpgradeProposalData, + DaData2, DaVote2, QuorumData2, QuorumVote2, TimeoutData, TimeoutVote, UpgradeProposalData, UpgradeVote, ViewSyncFinalizeData, ViewSyncFinalizeVote, }, traits::{ @@ -40,6 +40,7 @@ use hotshot_types::{ node_implementation::{ConsensusTime, NodeType}, BlockPayload, }, + utils::epoch_from_block_number, }; use rand::{thread_rng, Rng}; use sha2::{Digest, Sha256}; @@ -50,7 +51,7 @@ use crate::helpers::{ #[derive(Clone)] pub struct TestView { - pub da_proposal: Proposal>, + pub da_proposal: Proposal>, pub quorum_proposal: Proposal>, pub leaf: Leaf2, pub view_number: ViewNumber, @@ -62,7 +63,7 @@ pub struct TestView { ::SignatureKey, ), pub leader_public_key: ::SignatureKey, - pub da_certificate: DaCertificate, + pub da_certificate: DaCertificate2, pub transactions: Vec, upgrade_data: Option>, formed_upgrade_certificate: Option>, @@ -74,7 +75,7 @@ pub struct TestView { impl TestView { pub async fn genesis(membership: &::Membership) -> Self { let genesis_view = ViewNumber::new(1); - let genesis_epoch = EpochNumber::new(1); + let genesis_epoch = EpochNumber::new(0); let upgrade_lock = UpgradeLock::new(); let transactions = Vec::new(); @@ -152,10 +153,11 @@ impl TestView { ::SignatureKey::sign(&private_key, &encoded_transactions_hash) .expect("Failed to sign block payload"); - let da_proposal_inner = DaProposal:: { + let da_proposal_inner = DaProposal2:: { encoded_transactions: encoded_transactions.clone(), metadata, view_number: genesis_view, + epoch_number: genesis_epoch, }; let da_proposal = Proposal { @@ -217,6 +219,7 @@ impl TestView { let quorum_data = QuorumData2 { leaf_commit: old.leaf.commit(), + epoch: EpochNumber::new(0), }; let (old_private_key, old_public_key) = key_pair_for_id::(*old_view); @@ -306,7 +309,7 @@ impl TestView { TestVersions, ViewSyncFinalizeData, ViewSyncFinalizeVote, - ViewSyncFinalizeCertificate2, + ViewSyncFinalizeCertificate, >( data.clone(), membership, @@ -393,10 +396,11 @@ impl TestView { ::SignatureKey::sign(&private_key, &encoded_transactions_hash) .expect("Failed to sign block payload"); - let da_proposal_inner = DaProposal:: { + let da_proposal_inner = DaProposal2:: { encoded_transactions: encoded_transactions.clone(), metadata, view_number: next_view, + epoch_number: self.epoch_number, }; let da_proposal = Proposal { @@ -442,6 +446,10 @@ impl TestView { QuorumVote2::::create_signed_vote( QuorumData2 { leaf_commit: self.leaf.commit(), + epoch: EpochNumber::new(epoch_from_block_number( + self.leaf.height(), + handle.hotshot.config.epoch_height, + )), }, self.view_number, &handle.public_key(), @@ -470,10 +478,10 @@ impl TestView { pub async fn create_da_vote( &self, - data: DaData, + data: DaData2, handle: &SystemContextHandle, - ) -> DaVote { - DaVote::create_signed_vote( + ) -> DaVote2 { + DaVote2::create_signed_vote( data, self.view_number, &handle.public_key(), diff --git a/crates/testing/src/view_sync_task.rs b/crates/testing/src/view_sync_task.rs index 733164d341..914c8279cd 100644 --- a/crates/testing/src/view_sync_task.rs +++ b/crates/testing/src/view_sync_task.rs @@ -48,12 +48,12 @@ impl> TestTaskState | HotShotEvent::ViewSyncPreCommitVoteSend(_) | HotShotEvent::ViewSyncCommitVoteSend(_) | HotShotEvent::ViewSyncFinalizeVoteSend(_) - | HotShotEvent::ViewSyncPreCommitCertificate2Recv(_) - | HotShotEvent::ViewSyncCommitCertificate2Recv(_) - | HotShotEvent::ViewSyncFinalizeCertificate2Recv(_) - | HotShotEvent::ViewSyncPreCommitCertificate2Send(_, _) - | HotShotEvent::ViewSyncCommitCertificate2Send(_, _) - | HotShotEvent::ViewSyncFinalizeCertificate2Send(_, _) + | HotShotEvent::ViewSyncPreCommitCertificateRecv(_) + | HotShotEvent::ViewSyncCommitCertificateRecv(_) + | HotShotEvent::ViewSyncFinalizeCertificateRecv(_) + | HotShotEvent::ViewSyncPreCommitCertificateSend(_, _) + | HotShotEvent::ViewSyncCommitCertificateSend(_, _) + | HotShotEvent::ViewSyncFinalizeCertificateSend(_, _) | HotShotEvent::ViewSyncTrigger(_) => { self.hit_view_sync.insert(id); } diff --git a/crates/testing/tests/tests_1/da_task.rs b/crates/testing/tests/tests_1/da_task.rs index 6f4c2a38df..e672ff24e3 100644 --- a/crates/testing/tests/tests_1/da_task.rs +++ b/crates/testing/tests/tests_1/da_task.rs @@ -23,7 +23,7 @@ use hotshot_testing::{ }; use hotshot_types::{ data::{null_block, EpochNumber, PackedBundle, ViewNumber}, - simple_vote::DaData, + simple_vote::DaData2, traits::{ block_contents::precompute_vid_commitment, election::Membership, @@ -63,8 +63,14 @@ async fn test_da_task() { proposals.push(view.da_proposal.clone()); leaders.push(view.leader_public_key); votes.push( - view.create_da_vote(DaData { payload_commit }, &handle) - .await, + view.create_da_vote( + DaData2 { + payload_commit, + epoch: EpochNumber::new(0), + }, + &handle, + ) + .await, ); dacs.push(view.da_certificate.clone()); vids.push(view.vid_proposal.clone()); @@ -76,8 +82,14 @@ async fn test_da_task() { proposals.push(view.da_proposal.clone()); leaders.push(view.leader_public_key); votes.push( - view.create_da_vote(DaData { payload_commit }, &handle) - .await, + view.create_da_vote( + DaData2 { + payload_commit, + epoch: EpochNumber::new(0), + }, + &handle, + ) + .await, ); dacs.push(view.da_certificate.clone()); vids.push(view.vid_proposal.clone()); @@ -85,14 +97,15 @@ async fn test_da_task() { let inputs = vec![ serial![ - ViewChange(ViewNumber::new(1), EpochNumber::new(1)), - ViewChange(ViewNumber::new(2), EpochNumber::new(1)), + ViewChange(ViewNumber::new(1), EpochNumber::new(0)), + ViewChange(ViewNumber::new(2), EpochNumber::new(0)), BlockRecv(PackedBundle::new( encoded_transactions.clone(), TestMetadata { num_transactions: transactions.len() as u64 }, ViewNumber::new(2), + EpochNumber::new(0), vec1::vec1![null_block::builder_fee::( membership.total_nodes(EpochNumber::new(0)), ::Base::VERSION, @@ -158,8 +171,14 @@ async fn test_da_task_storage_failure() { proposals.push(view.da_proposal.clone()); leaders.push(view.leader_public_key); votes.push( - view.create_da_vote(DaData { payload_commit }, &handle) - .await, + view.create_da_vote( + DaData2 { + payload_commit, + epoch: EpochNumber::new(0), + }, + &handle, + ) + .await, ); dacs.push(view.da_certificate.clone()); vids.push(view.vid_proposal.clone()); @@ -171,8 +190,14 @@ async fn test_da_task_storage_failure() { proposals.push(view.da_proposal.clone()); leaders.push(view.leader_public_key); votes.push( - view.create_da_vote(DaData { payload_commit }, &handle) - .await, + view.create_da_vote( + DaData2 { + payload_commit, + epoch: EpochNumber::new(0), + }, + &handle, + ) + .await, ); dacs.push(view.da_certificate.clone()); vids.push(view.vid_proposal.clone()); @@ -180,14 +205,15 @@ async fn test_da_task_storage_failure() { let inputs = vec![ serial![ - ViewChange(ViewNumber::new(1), EpochNumber::new(1)), - ViewChange(ViewNumber::new(2), EpochNumber::new(1)), + ViewChange(ViewNumber::new(1), EpochNumber::new(0)), + ViewChange(ViewNumber::new(2), EpochNumber::new(0)), BlockRecv(PackedBundle::new( encoded_transactions.clone(), TestMetadata { num_transactions: transactions.len() as u64 }, ViewNumber::new(2), + EpochNumber::new(0), vec1::vec1![null_block::builder_fee::( membership.total_nodes(EpochNumber::new(0)), ::Base::VERSION, diff --git a/crates/testing/tests/tests_1/quorum_proposal_task.rs b/crates/testing/tests/tests_1/quorum_proposal_task.rs index 0124e10b5a..25e70fc6c2 100644 --- a/crates/testing/tests/tests_1/quorum_proposal_task.rs +++ b/crates/testing/tests/tests_1/quorum_proposal_task.rs @@ -440,7 +440,7 @@ async fn test_quorum_proposal_task_view_sync() { }; let inputs = vec![random![ - ViewSyncFinalizeCertificate2Recv(cert.clone()), + ViewSyncFinalizeCertificateRecv(cert.clone()), SendPayloadCommitmentAndMetadata( payload_commitment, builder_commitment, diff --git a/crates/testing/tests/tests_1/transaction_task.rs b/crates/testing/tests/tests_1/transaction_task.rs index 43773e63da..e4ed70be64 100644 --- a/crates/testing/tests/tests_1/transaction_task.rs +++ b/crates/testing/tests/tests_1/transaction_task.rs @@ -52,6 +52,7 @@ async fn test_transaction_task_leader_two_views_in_a_row() { num_transactions: 0, }, current_view, + EpochNumber::new(1), vec1::vec1![ null_block::builder_fee::( handle.hotshot.memberships.total_nodes(EpochNumber::new(0)), diff --git a/crates/testing/tests/tests_1/vid_task.rs b/crates/testing/tests/tests_1/vid_task.rs index 81f9ac2999..3bf19bbc38 100644 --- a/crates/testing/tests/tests_1/vid_task.rs +++ b/crates/testing/tests/tests_1/vid_task.rs @@ -108,6 +108,7 @@ async fn test_vid_task() { num_transactions: transactions.len() as u64 }, ViewNumber::new(2), + EpochNumber::new(0), vec1::vec1![null_block::builder_fee::( membership.total_nodes(EpochNumber::new(0)), ::Base::VERSION, diff --git a/crates/types/src/consensus.rs b/crates/types/src/consensus.rs index 2d2e814e9f..0c2e8d936f 100644 --- a/crates/types/src/consensus.rs +++ b/crates/types/src/consensus.rs @@ -25,7 +25,7 @@ use crate::{ error::HotShotError, event::{HotShotAction, LeafInfo}, message::Proposal, - simple_certificate::{DaCertificate, QuorumCertificate2}, + simple_certificate::{DaCertificate2, QuorumCertificate2}, traits::{ block_contents::BuilderFee, metrics::{Counter, Gauge, Histogram, Metrics, NoMetrics}, @@ -281,7 +281,7 @@ pub struct Consensus { /// All the DA certs we've received for current and future views. /// view -> DA cert - saved_da_certs: HashMap>, + saved_da_certs: HashMap>, /// View number that is currently on. cur_view: TYPES::View, @@ -479,7 +479,7 @@ impl Consensus { } /// Get the saved DA certs. - pub fn saved_da_certs(&self) -> &HashMap> { + pub fn saved_da_certs(&self) -> &HashMap> { &self.saved_da_certs } @@ -747,7 +747,7 @@ impl Consensus { } /// Add a new entry to the da_certs map. - pub fn update_saved_da_certs(&mut self, view_number: TYPES::View, cert: DaCertificate) { + pub fn update_saved_da_certs(&mut self, view_number: TYPES::View, cert: DaCertificate2) { self.saved_da_certs.insert(view_number, cert); } diff --git a/crates/types/src/data.rs b/crates/types/src/data.rs index 422f2887cb..b6ec66f16a 100644 --- a/crates/types/src/data.rs +++ b/crates/types/src/data.rs @@ -34,7 +34,7 @@ use crate::{ message::{Proposal, UpgradeLock}, simple_certificate::{ QuorumCertificate, QuorumCertificate2, TimeoutCertificate, UpgradeCertificate, - ViewSyncFinalizeCertificate2, + ViewSyncFinalizeCertificate, }, simple_vote::{QuorumData, UpgradeProposalData, VersionedVoteData}, traits::{ @@ -147,6 +147,41 @@ pub struct DaProposal { pub view_number: TYPES::View, } +/// A proposal to start providing data availability for a block. +#[derive(derive_more::Debug, Serialize, Deserialize, Clone, Eq, PartialEq, Hash)] +#[serde(bound = "TYPES: NodeType")] +pub struct DaProposal2 { + /// Encoded transactions in the block to be applied. + pub encoded_transactions: Arc<[u8]>, + /// Metadata of the block to be applied. + pub metadata: >::Metadata, + /// View this proposal applies to + pub view_number: TYPES::View, + /// Epoch this proposal applies to + pub epoch_number: TYPES::Epoch, +} + +impl From> for DaProposal2 { + fn from(da_proposal: DaProposal) -> Self { + Self { + encoded_transactions: da_proposal.encoded_transactions, + metadata: da_proposal.metadata, + view_number: da_proposal.view_number, + epoch_number: TYPES::Epoch::new(0), + } + } +} + +impl From> for DaProposal { + fn from(da_proposal2: DaProposal2) -> Self { + Self { + encoded_transactions: da_proposal2.encoded_transactions, + metadata: da_proposal2.metadata, + view_number: da_proposal2.view_number, + } + } +} + /// A proposal to upgrade the network #[derive(derive_more::Debug, Serialize, Deserialize, Clone, Eq, PartialEq, Hash)] #[serde(bound = "TYPES: NodeType")] @@ -239,7 +274,7 @@ pub enum ViewChangeEvidence { /// Holds a timeout certificate. Timeout(TimeoutCertificate), /// Holds a view sync finalized certificate. - ViewSync(ViewSyncFinalizeCertificate2), + ViewSync(ViewSyncFinalizeCertificate), } impl ViewChangeEvidence { @@ -420,13 +455,13 @@ impl From> for QuorumProposal2 { } impl From> for QuorumProposal { - fn from(quorum_proposal: QuorumProposal2) -> Self { + fn from(quorum_proposal2: QuorumProposal2) -> Self { Self { - block_header: quorum_proposal.block_header, - view_number: quorum_proposal.view_number, - justify_qc: quorum_proposal.justify_qc.to_qc(), - upgrade_certificate: quorum_proposal.upgrade_certificate, - proposal_certificate: quorum_proposal.view_change_evidence, + block_header: quorum_proposal2.block_header, + view_number: quorum_proposal2.view_number, + justify_qc: quorum_proposal2.justify_qc.to_qc(), + upgrade_certificate: quorum_proposal2.upgrade_certificate, + proposal_certificate: quorum_proposal2.view_change_evidence, } } } @@ -455,6 +490,12 @@ impl HasViewNumber for DaProposal { } } +impl HasViewNumber for DaProposal2 { + fn view_number(&self) -> TYPES::View { + self.view_number + } +} + impl HasViewNumber for VidDisperse { fn view_number(&self) -> TYPES::View { self.view_number @@ -1226,6 +1267,9 @@ pub struct PackedBundle { /// The view number that this block is associated with. pub view_number: TYPES::View, + /// The view number that this block is associated with. + pub epoch_number: TYPES::Epoch, + /// The sequencing fee for submitting bundles. pub sequencing_fees: Vec1>, @@ -1242,6 +1286,7 @@ impl PackedBundle { encoded_transactions: Arc<[u8]>, metadata: >::Metadata, view_number: TYPES::View, + epoch_number: TYPES::Epoch, sequencing_fees: Vec1>, vid_precompute: Option, auction_result: Option, @@ -1250,6 +1295,7 @@ impl PackedBundle { encoded_transactions, metadata, view_number, + epoch_number, sequencing_fees, vid_precompute, auction_result, diff --git a/crates/types/src/event.rs b/crates/types/src/event.rs index c4ae586866..0a79913d88 100644 --- a/crates/types/src/event.rs +++ b/crates/types/src/event.rs @@ -11,12 +11,13 @@ use std::sync::Arc; use serde::{Deserialize, Serialize}; use crate::{ - data::{DaProposal, Leaf2, QuorumProposal2, UpgradeProposal, VidDisperseShare}, + data::{DaProposal2, Leaf2, QuorumProposal2, UpgradeProposal, VidDisperseShare}, error::HotShotError, message::Proposal, simple_certificate::QuorumCertificate2, traits::{node_implementation::NodeType, ValidatedState}, }; + /// A status event emitted by a `HotShot` instance /// /// This includes some metadata, such as the stage and view number that the event was generated in, @@ -151,7 +152,7 @@ pub enum EventType { /// or submitted to the network by us DaProposal { /// Contents of the proposal - proposal: Proposal>, + proposal: Proposal>, /// Public key of the leader submitting the proposal sender: TYPES::SignatureKey, }, diff --git a/crates/types/src/message.rs b/crates/types/src/message.rs index eb4861d22e..062ae9c96f 100644 --- a/crates/types/src/message.rs +++ b/crates/types/src/message.rs @@ -26,16 +26,17 @@ use vbs::{ use crate::{ data::{ - DaProposal, Leaf, Leaf2, QuorumProposal, QuorumProposal2, UpgradeProposal, VidDisperseShare, + DaProposal, DaProposal2, Leaf, Leaf2, QuorumProposal, QuorumProposal2, UpgradeProposal, + VidDisperseShare, }, request_response::ProposalRequestPayload, simple_certificate::{ - DaCertificate, QuorumCertificate2, UpgradeCertificate, ViewSyncCommitCertificate2, - ViewSyncFinalizeCertificate2, ViewSyncPreCommitCertificate2, + DaCertificate, DaCertificate2, QuorumCertificate2, UpgradeCertificate, + ViewSyncCommitCertificate, ViewSyncFinalizeCertificate, ViewSyncPreCommitCertificate, }, simple_vote::{ - DaVote, QuorumVote, TimeoutVote, UpgradeVote, ViewSyncCommitVote, ViewSyncFinalizeVote, - ViewSyncPreCommitVote, + DaVote, DaVote2, QuorumVote, QuorumVote2, TimeoutVote, UpgradeVote, ViewSyncCommitVote, + ViewSyncFinalizeVote, ViewSyncPreCommitVote, }, traits::{ election::Membership, @@ -183,13 +184,13 @@ pub enum GeneralConsensusMessage { ViewSyncFinalizeVote(ViewSyncFinalizeVote), /// Message with a view sync pre-commit certificate - ViewSyncPreCommitCertificate(ViewSyncPreCommitCertificate2), + ViewSyncPreCommitCertificate(ViewSyncPreCommitCertificate), /// Message with a view sync commit certificate - ViewSyncCommitCertificate(ViewSyncCommitCertificate2), + ViewSyncCommitCertificate(ViewSyncCommitCertificate), /// Message with a view sync finalize certificate - ViewSyncFinalizeCertificate(ViewSyncFinalizeCertificate2), + ViewSyncFinalizeCertificate(ViewSyncFinalizeCertificate), /// Message with a Timeout vote TimeoutVote(TimeoutVote), @@ -200,6 +201,15 @@ pub enum GeneralConsensusMessage { /// Message with an upgrade vote UpgradeVote(UpgradeVote), + /// Message for the next leader containing our highest QC + HighQc(QuorumCertificate2), + + /// Message with a quorum proposal. + Proposal2(Proposal>), + + /// Message with a quorum vote. + Vote2(QuorumVote2), + /// A peer node needs a proposal from the leader. ProposalRequested( ProposalRequestPayload, @@ -209,8 +219,8 @@ pub enum GeneralConsensusMessage { /// A replica has responded with a valid proposal. ProposalResponse(Proposal>), - /// Message for the next leader containing our highest QC - HighQc(QuorumCertificate2), + /// A replica has responded with a valid proposal. + Proposal2Response(Proposal>), } #[derive(Deserialize, Serialize, Clone, Debug, PartialEq, Hash, Eq)] @@ -230,6 +240,15 @@ pub enum DaConsensusMessage { /// /// Like [`DaProposal`]. Use `Msg` suffix to distinguish from `VidDisperse`. VidDisperseMsg(Proposal>), + + /// Proposal for data availability committee + DaProposal2(Proposal>), + + /// vote for data availability committee + DaVote2(DaVote2), + + /// Certificate data is available + DaCertificate2(DaCertificate2), } /// Messages for sequencing consensus. @@ -258,6 +277,9 @@ impl SequencingMessage { GeneralConsensusMessage::ProposalResponse(proposal) => { proposal.data.view_number() } + GeneralConsensusMessage::Proposal2Response(proposal) => { + proposal.data.view_number() + } GeneralConsensusMessage::Vote(vote_message) => vote_message.view_number(), GeneralConsensusMessage::TimeoutVote(message) => message.view_number(), GeneralConsensusMessage::ViewSyncPreCommitVote(message) => { @@ -277,6 +299,12 @@ impl SequencingMessage { GeneralConsensusMessage::UpgradeProposal(message) => message.data.view_number(), GeneralConsensusMessage::UpgradeVote(message) => message.view_number(), GeneralConsensusMessage::HighQc(qc) => qc.view_number(), + GeneralConsensusMessage::Proposal2(p) => { + // view of leader in the leaf when proposal + // this should match replica upon receipt + p.data.view_number() + } + GeneralConsensusMessage::Vote2(vote_message) => vote_message.view_number(), } } SequencingMessage::Da(da_message) => { @@ -289,6 +317,13 @@ impl SequencingMessage { DaConsensusMessage::DaVote(vote_message) => vote_message.view_number(), DaConsensusMessage::DaCertificate(cert) => cert.view_number, DaConsensusMessage::VidDisperseMsg(disperse) => disperse.data.view_number(), + DaConsensusMessage::DaProposal2(p) => { + // view of leader in the leaf when proposal + // this should match replica upon receipt + p.data.view_number() + } + DaConsensusMessage::DaVote2(vote_message) => vote_message.view_number(), + DaConsensusMessage::DaCertificate2(cert) => cert.view_number, } } } diff --git a/crates/types/src/simple_certificate.rs b/crates/types/src/simple_certificate.rs index f2cc8cd689..f88e549ede 100644 --- a/crates/types/src/simple_certificate.rs +++ b/crates/types/src/simple_certificate.rs @@ -24,8 +24,9 @@ use crate::{ data::serialize_signature2, message::UpgradeLock, simple_vote::{ - DaData, QuorumData, QuorumData2, QuorumMarker, TimeoutData, UpgradeProposalData, - VersionedVoteData, ViewSyncCommitData, ViewSyncFinalizeData, ViewSyncPreCommitData, + DaData, DaData2, QuorumData, QuorumData2, QuorumMarker, TimeoutData, TimeoutData2, + UpgradeProposalData, VersionedVoteData, ViewSyncCommitData, ViewSyncCommitData2, + ViewSyncFinalizeData, ViewSyncFinalizeData2, ViewSyncPreCommitData, ViewSyncPreCommitData2, Voteable, }, traits::{ @@ -225,6 +226,94 @@ impl> Certificate } } +impl> Certificate> + for SimpleCertificate, THRESHOLD> +{ + type Voteable = DaData2; + type Threshold = THRESHOLD; + + fn create_signed_certificate( + vote_commitment: Commitment, V>>, + data: Self::Voteable, + sig: ::QcType, + view: TYPES::View, + ) -> Self { + let vote_commitment_bytes: [u8; 32] = vote_commitment.into(); + + SimpleCertificate { + data, + vote_commitment: Commitment::from_raw(vote_commitment_bytes), + view_number: view, + signatures: Some(sig), + _pd: PhantomData, + } + } + async fn is_valid_cert( + &self, + stake_table: Vec<::StakeTableEntry>, + threshold: NonZeroU64, + upgrade_lock: &UpgradeLock, + ) -> bool { + if self.view_number == TYPES::View::genesis() { + return true; + } + let real_qc_pp = ::public_parameter( + stake_table, + U256::from(u64::from(threshold)), + ); + let Ok(commit) = self.data_commitment(upgrade_lock).await else { + return false; + }; + ::check( + &real_qc_pp, + commit.as_ref(), + self.signatures.as_ref().unwrap(), + ) + } + /// Proxy's to `Membership.stake` + fn stake_table_entry>( + membership: &MEMBERSHIP, + pub_key: &TYPES::SignatureKey, + epoch: TYPES::Epoch, + ) -> Option<::StakeTableEntry> { + membership.da_stake(pub_key, epoch) + } + + /// Proxy's to `Membership.da_stake_table` + fn stake_table>( + membership: &MEMBERSHIP, + epoch: TYPES::Epoch, + ) -> Vec<::StakeTableEntry> { + membership.da_stake_table(epoch) + } + /// Proxy's to `Membership.da_total_nodes` + fn total_nodes>( + membership: &MEMBERSHIP, + epoch: TYPES::Epoch, + ) -> usize { + membership.da_total_nodes(epoch) + } + fn threshold>( + membership: &MEMBERSHIP, + epoch: TYPES::Epoch, + ) -> u64 { + membership.da_success_threshold(epoch).into() + } + fn data(&self) -> &Self::Voteable { + &self.data + } + async fn data_commitment( + &self, + upgrade_lock: &UpgradeLock, + ) -> Result, V>>> { + Ok( + VersionedVoteData::new(self.data.clone(), self.view_number, upgrade_lock) + .await? + .commit(), + ) + } +} + impl> Certificate for SimpleCertificate { @@ -388,6 +477,7 @@ impl QuorumCertificate { let bytes: [u8; 32] = self.data.leaf_commit.into(); let data = QuorumData2 { leaf_commit: Commitment::from_raw(bytes), + epoch: TYPES::Epoch::new(0), }; let bytes: [u8; 32] = self.vote_commitment.into(); @@ -424,23 +514,248 @@ impl QuorumCertificate2 { } } +impl DaCertificate { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_dac2(self) -> DaCertificate2 { + let data = DaData2 { + payload_commit: self.data.payload_commit, + epoch: TYPES::Epoch::new(0), + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl DaCertificate2 { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_dac(self) -> DaCertificate { + let data = DaData { + payload_commit: self.data.payload_commit, + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl ViewSyncPreCommitCertificate { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc2(self) -> ViewSyncPreCommitCertificate2 { + let data = ViewSyncPreCommitData2 { + relay: self.data.relay, + round: self.data.round, + epoch: TYPES::Epoch::new(0), + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl ViewSyncPreCommitCertificate2 { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc(self) -> ViewSyncPreCommitCertificate { + let data = ViewSyncPreCommitData { + relay: self.data.relay, + round: self.data.round, + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl ViewSyncCommitCertificate { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc2(self) -> ViewSyncCommitCertificate2 { + let data = ViewSyncCommitData2 { + relay: self.data.relay, + round: self.data.round, + epoch: TYPES::Epoch::new(0), + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl ViewSyncCommitCertificate2 { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc(self) -> ViewSyncCommitCertificate { + let data = ViewSyncCommitData { + relay: self.data.relay, + round: self.data.round, + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl ViewSyncFinalizeCertificate { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc2(self) -> ViewSyncFinalizeCertificate2 { + let data = ViewSyncFinalizeData2 { + relay: self.data.relay, + round: self.data.round, + epoch: TYPES::Epoch::new(0), + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl ViewSyncFinalizeCertificate2 { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc(self) -> ViewSyncFinalizeCertificate { + let data = ViewSyncFinalizeData { + relay: self.data.relay, + round: self.data.round, + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl TimeoutCertificate { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc2(self) -> TimeoutCertificate2 { + let data = TimeoutData2 { + view: self.data.view, + epoch: TYPES::Epoch::new(0), + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + +impl TimeoutCertificate2 { + /// Convert a `DaCertificate` into a `DaCertificate2` + pub fn to_vsc(self) -> TimeoutCertificate { + let data = TimeoutData { + view: self.data.view, + }; + + let bytes: [u8; 32] = self.vote_commitment.into(); + let vote_commitment = Commitment::from_raw(bytes); + + SimpleCertificate { + data, + vote_commitment, + view_number: self.view_number, + signatures: self.signatures.clone(), + _pd: PhantomData, + } + } +} + /// Type alias for a `QuorumCertificate`, which is a `SimpleCertificate` over `QuorumData` pub type QuorumCertificate = SimpleCertificate, SuccessThreshold>; /// Type alias for a `QuorumCertificate2`, which is a `SimpleCertificate` over `QuorumData2` pub type QuorumCertificate2 = SimpleCertificate, SuccessThreshold>; -/// Type alias for a DA certificate over `DaData` +/// Type alias for a `DaCertificate`, which is a `SimpleCertificate` over `DaData` pub type DaCertificate = SimpleCertificate; +/// Type alias for a `DaCertificate2`, which is a `SimpleCertificate` over `DaData2` +pub type DaCertificate2 = SimpleCertificate, SuccessThreshold>; /// Type alias for a Timeout certificate over a view number pub type TimeoutCertificate = SimpleCertificate, SuccessThreshold>; +/// Type alias for a `TimeoutCertificate2`, which is a `SimpleCertificate` over `TimeoutData2` +pub type TimeoutCertificate2 = + SimpleCertificate, SuccessThreshold>; /// Type alias for a `ViewSyncPreCommit` certificate over a view number -pub type ViewSyncPreCommitCertificate2 = +pub type ViewSyncPreCommitCertificate = SimpleCertificate, OneHonestThreshold>; +/// Type alias for a `ViewSyncPreCommitCertificate2`, which is a `SimpleCertificate` over `ViewSyncPreCommitData2` +pub type ViewSyncPreCommitCertificate2 = + SimpleCertificate, OneHonestThreshold>; /// Type alias for a `ViewSyncCommit` certificate over a view number -pub type ViewSyncCommitCertificate2 = +pub type ViewSyncCommitCertificate = SimpleCertificate, SuccessThreshold>; +/// Type alias for a `ViewSyncCommitCertificate2`, which is a `SimpleCertificate` over `ViewSyncCommitData2` +pub type ViewSyncCommitCertificate2 = + SimpleCertificate, SuccessThreshold>; /// Type alias for a `ViewSyncFinalize` certificate over a view number -pub type ViewSyncFinalizeCertificate2 = +pub type ViewSyncFinalizeCertificate = SimpleCertificate, SuccessThreshold>; +/// Type alias for a `ViewSyncFinalizeCertificate2`, which is a `SimpleCertificate` over `ViewSyncFinalizeData2` +pub type ViewSyncFinalizeCertificate2 = + SimpleCertificate, SuccessThreshold>; /// Type alias for a `UpgradeCertificate`, which is a `SimpleCertificate` of `UpgradeProposalData` pub type UpgradeCertificate = SimpleCertificate, UpgradeThreshold>; diff --git a/crates/types/src/simple_vote.rs b/crates/types/src/simple_vote.rs index 138f730fb9..98af9fe67d 100644 --- a/crates/types/src/simple_vote.rs +++ b/crates/types/src/simple_vote.rs @@ -17,7 +17,7 @@ use crate::{ data::{Leaf, Leaf2}, message::UpgradeLock, traits::{ - node_implementation::{NodeType, Versions}, + node_implementation::{ConsensusTime, NodeType, Versions}, signature_key::SignatureKey, }, vid::VidCommitment, @@ -40,6 +40,8 @@ pub struct QuorumData { pub struct QuorumData2 { /// Commitment to the leaf pub leaf_commit: Commitment>, + /// Epoch number + pub epoch: TYPES::Epoch, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] /// Data used for a DA vote. @@ -48,12 +50,27 @@ pub struct DaData { pub payload_commit: VidCommitment, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] +/// Data used for a DA vote. +pub struct DaData2 { + /// Commitment to a block payload + pub payload_commit: VidCommitment, + /// Epoch number + pub epoch: TYPES::Epoch, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] /// Data used for a timeout vote. pub struct TimeoutData { /// View the timeout is for pub view: TYPES::View, } - +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] +/// Data used for a timeout vote. +pub struct TimeoutData2 { + /// View the timeout is for + pub view: TYPES::View, + /// Epoch number + pub epoch: TYPES::Epoch, +} #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] /// Data used for a Pre Commit vote. pub struct ViewSyncPreCommitData { @@ -63,6 +80,16 @@ pub struct ViewSyncPreCommitData { pub round: TYPES::View, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] +/// Data used for a Pre Commit vote. +pub struct ViewSyncPreCommitData2 { + /// The relay this vote is intended for + pub relay: u64, + /// The view number we are trying to sync on + pub round: TYPES::View, + /// Epoch number + pub epoch: TYPES::Epoch, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] /// Data used for a Commit vote. pub struct ViewSyncCommitData { /// The relay this vote is intended for @@ -71,6 +98,16 @@ pub struct ViewSyncCommitData { pub round: TYPES::View, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] +/// Data used for a Commit vote. +pub struct ViewSyncCommitData2 { + /// The relay this vote is intended for + pub relay: u64, + /// The view number we are trying to sync on + pub round: TYPES::View, + /// Epoch number + pub epoch: TYPES::Epoch, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] /// Data used for a Finalize vote. pub struct ViewSyncFinalizeData { /// The relay this vote is intended for @@ -79,6 +116,16 @@ pub struct ViewSyncFinalizeData { pub round: TYPES::View, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] +/// Data used for a Finalize vote. +pub struct ViewSyncFinalizeData2 { + /// The relay this vote is intended for + pub relay: u64, + /// The view number we are trying to sync on + pub round: TYPES::View, + /// Epoch number + pub epoch: TYPES::Epoch, +} +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Hash, Eq)] /// Data used for a Upgrade vote. pub struct UpgradeProposalData { /// The old version that we are upgrading from. @@ -96,6 +143,18 @@ pub struct UpgradeProposalData { pub new_version_first_view: TYPES::View, } +/// Data used for an upgrade once epochs are implemented +pub struct UpgradeData2 { + /// The old version that we are upgrading from + pub old_version: Version, + /// The new version that we are upgrading to + pub new_version: Version, + /// A unique identifier for the specific protocol being voted on + pub hash: Vec, + /// The first epoch in which the upgrade will be in effect + pub epoch: TYPES::Epoch, +} + /// Marker trait for data or commitments that can be voted on. /// Only structs in this file can implement voteable. This is enforced with the `Sealed` trait /// Sealing this trait prevents creating new vote types outside this file. @@ -120,9 +179,13 @@ mod sealed { impl QuorumMarker for QuorumData {} impl QuorumMarker for QuorumData2 {} impl QuorumMarker for TimeoutData {} +impl QuorumMarker for TimeoutData2 {} impl QuorumMarker for ViewSyncPreCommitData {} impl QuorumMarker for ViewSyncCommitData {} impl QuorumMarker for ViewSyncFinalizeData {} +impl QuorumMarker for ViewSyncPreCommitData2 {} +impl QuorumMarker for ViewSyncCommitData2 {} +impl QuorumMarker for ViewSyncFinalizeData2 {} impl QuorumMarker for UpgradeProposalData {} /// A simple yes vote over some votable type. @@ -272,9 +335,18 @@ impl Committable for QuorumData { impl Committable for QuorumData2 { fn commit(&self) -> Commitment { - committable::RawCommitmentBuilder::new("Quorum data") - .var_size_bytes(self.leaf_commit.as_ref()) - .finalize() + let QuorumData2 { leaf_commit, epoch } = self; + + if **epoch == 0 { + committable::RawCommitmentBuilder::new("Quorum data") + .var_size_bytes(leaf_commit.as_ref()) + .finalize() + } else { + committable::RawCommitmentBuilder::new("Quorum data") + .var_size_bytes(leaf_commit.as_ref()) + .u64(**epoch) + .finalize() + } } } @@ -286,6 +358,23 @@ impl Committable for TimeoutData { } } +impl Committable for TimeoutData2 { + fn commit(&self) -> Commitment { + let TimeoutData2 { view, epoch } = self; + + if **epoch == 0 { + committable::RawCommitmentBuilder::new("Timeout data") + .u64(**view) + .finalize() + } else { + committable::RawCommitmentBuilder::new("Timeout data") + .u64(**view) + .u64(**epoch) + .finalize() + } + } +} + impl Committable for DaData { fn commit(&self) -> Commitment { committable::RawCommitmentBuilder::new("DA data") @@ -294,6 +383,25 @@ impl Committable for DaData { } } +impl Committable for DaData2 { + fn commit(&self) -> Commitment { + let DaData2 { + payload_commit, + epoch, + } = self; + if **epoch == 0 { + committable::RawCommitmentBuilder::new("DA data") + .var_size_bytes(payload_commit.as_ref()) + .finalize() + } else { + committable::RawCommitmentBuilder::new("DA data") + .var_size_bytes(payload_commit.as_ref()) + .u64(**epoch) + .finalize() + } + } +} + impl Committable for UpgradeProposalData { fn commit(&self) -> Commitment { let builder = committable::RawCommitmentBuilder::new("Upgrade data"); @@ -310,6 +418,26 @@ impl Committable for UpgradeProposalData { } } +impl Committable for UpgradeData2 { + fn commit(&self) -> Commitment { + let UpgradeData2 { + old_version, + new_version, + hash, + epoch, + } = self; + + committable::RawCommitmentBuilder::new("Upgrade data") + .u16(old_version.minor) + .u16(old_version.major) + .u16(new_version.minor) + .u16(new_version.major) + .var_size_bytes(hash.as_slice()) + .u64(**epoch) + .finalize() + } +} + /// This implements commit for all the types which contain a view and relay public key. fn view_and_relay_commit( view: TYPES::View, @@ -326,18 +454,79 @@ impl Committable for ViewSyncPreCommitData { } } +impl Committable for ViewSyncPreCommitData2 { + fn commit(&self) -> Commitment { + let ViewSyncPreCommitData2 { + relay, + round, + epoch, + } = self; + + if **epoch == 0 { + view_and_relay_commit::(*round, *relay, "View Sync Precommit") + } else { + committable::RawCommitmentBuilder::new("View Sync Precommit") + .u64(*relay) + .u64(**round) + .u64(**epoch) + .finalize() + } + } +} + impl Committable for ViewSyncFinalizeData { fn commit(&self) -> Commitment { view_and_relay_commit::(self.round, self.relay, "View Sync Finalize") } } + +impl Committable for ViewSyncFinalizeData2 { + fn commit(&self) -> Commitment { + let ViewSyncFinalizeData2 { + relay, + round, + epoch, + } = self; + + if **epoch == 0 { + view_and_relay_commit::(*round, *relay, "View Sync Finalize") + } else { + committable::RawCommitmentBuilder::new("View Sync Finalize") + .u64(*relay) + .u64(**round) + .u64(**epoch) + .finalize() + } + } +} + impl Committable for ViewSyncCommitData { fn commit(&self) -> Commitment { view_and_relay_commit::(self.round, self.relay, "View Sync Commit") } } -// impl votable for all the data types in this file sealed marker should ensure nothing is accidently +impl Committable for ViewSyncCommitData2 { + fn commit(&self) -> Commitment { + let ViewSyncCommitData2 { + relay, + round, + epoch, + } = self; + + if **epoch == 0 { + view_and_relay_commit::(*round, *relay, "View Sync Commit") + } else { + committable::RawCommitmentBuilder::new("View Sync Commit") + .u64(*relay) + .u64(**round) + .u64(**epoch) + .finalize() + } + } +} + +// impl votable for all the data types in this file sealed marker should ensure nothing is accidentally // implemented for structs that aren't "voteable" impl Voteable for V @@ -352,6 +541,7 @@ impl QuorumVote { let signature = self.signature; let data = QuorumData2 { leaf_commit: Commitment::from_raw(bytes), + epoch: TYPES::Epoch::new(0), }; let view_number = self.view_number; @@ -382,21 +572,73 @@ impl QuorumVote2 { } } +impl DaVote { + /// Convert a `QuorumVote` to a `QuorumVote2` + pub fn to_vote2(self) -> DaVote2 { + let signature = self.signature; + let data = DaData2 { + payload_commit: self.data.payload_commit, + epoch: TYPES::Epoch::new(0), + }; + let view_number = self.view_number; + + SimpleVote { + signature, + data, + view_number, + } + } +} + +impl DaVote2 { + /// Convert a `QuorumVote2` to a `QuorumVote` + pub fn to_vote(self) -> DaVote { + let signature = self.signature; + let data = DaData { + payload_commit: self.data.payload_commit, + }; + let view_number = self.view_number; + + SimpleVote { + signature, + data, + view_number, + } + } +} + // Type aliases for simple use of all the main votes. We should never see `SimpleVote` outside this file + /// Quorum vote Alias pub type QuorumVote = SimpleVote>; // Type aliases for simple use of all the main votes. We should never see `SimpleVote` outside this file /// Quorum vote Alias pub type QuorumVote2 = SimpleVote>; + /// DA vote type alias pub type DaVote = SimpleVote; +/// DA vote 2 type alias +pub type DaVote2 = SimpleVote>; + /// Timeout Vote type alias pub type TimeoutVote = SimpleVote>; -/// View Sync Commit Vote type alias -pub type ViewSyncCommitVote = SimpleVote>; +/// Timeout Vote 2 type alias +pub type TimeoutVote2 = SimpleVote>; + /// View Sync Pre Commit Vote type alias pub type ViewSyncPreCommitVote = SimpleVote>; +/// View Sync Pre Commit Vote 2 type alias +pub type ViewSyncPreCommitVote2 = SimpleVote>; /// View Sync Finalize Vote type alias pub type ViewSyncFinalizeVote = SimpleVote>; +/// View Sync Finalize Vote 2 type alias +pub type ViewSyncFinalizeVote2 = SimpleVote>; +/// View Sync Commit Vote type alias +pub type ViewSyncCommitVote = SimpleVote>; +/// View Sync Commit Vote 2 type alias +pub type ViewSyncCommitVote2 = SimpleVote>; + /// Upgrade proposal vote pub type UpgradeVote = SimpleVote>; +/// Upgrade proposal 2 vote +pub type UpgradeVote2 = SimpleVote>; diff --git a/crates/types/src/traits/storage.rs b/crates/types/src/traits/storage.rs index 7782ef0101..a0e226cdbd 100644 --- a/crates/types/src/traits/storage.rs +++ b/crates/types/src/traits/storage.rs @@ -18,7 +18,9 @@ use jf_vid::VidScheme; use super::node_implementation::NodeType; use crate::{ consensus::{CommitmentMap, View}, - data::{DaProposal, Leaf, Leaf2, QuorumProposal, QuorumProposal2, VidDisperseShare}, + data::{ + DaProposal, DaProposal2, Leaf, Leaf2, QuorumProposal, QuorumProposal2, VidDisperseShare, + }, event::HotShotAction, message::Proposal, simple_certificate::{QuorumCertificate, QuorumCertificate2, UpgradeCertificate}, @@ -36,6 +38,12 @@ pub trait Storage: Send + Sync + Clone { proposal: &Proposal>, vid_commit: ::Commit, ) -> Result<()>; + /// Add a proposal to the stored DA proposals. + async fn append_da2( + &self, + proposal: &Proposal>, + vid_commit: ::Commit, + ) -> Result<()>; /// Add a proposal we sent to the store async fn append_proposal( &self, diff --git a/docs/diagrams/HotShotFlow.drawio b/docs/diagrams/HotShotFlow.drawio index c6ac0dafb0..734c88ff2e 100644 --- a/docs/diagrams/HotShotFlow.drawio +++ b/docs/diagrams/HotShotFlow.drawio @@ -1937,7 +1937,7 @@ - +