diff --git a/Cargo.lock b/Cargo.lock index d008dd5339975..bdfdf42ec87ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,7 +39,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfe0133578c0986e1fe3dfcd4af1cc5b2dd6c3dbf534d69916ce16a2701d40ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cipher", "cpufeatures", ] @@ -248,7 +248,7 @@ dependencies = [ "num-traits 0.2.15", "paste", "rayon", - "rustc_version 0.3.3", + "rustc_version", "zeroize", ] @@ -573,7 +573,7 @@ checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -777,7 +777,7 @@ dependencies = [ "arrayref", "arrayvec 0.7.2", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", "digest 0.10.5", ] @@ -1039,12 +1039,6 @@ dependencies = [ "target-lexicon", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -1364,7 +1358,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1397,7 +1391,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1444,7 +1438,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -1458,7 +1452,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -1468,7 +1462,7 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -1480,7 +1474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" dependencies = [ "autocfg", - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "lazy_static 1.4.0", "memoffset", @@ -1493,7 +1487,7 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -1503,7 +1497,7 @@ version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "lazy_static 1.4.0", ] @@ -1809,7 +1803,7 @@ version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown", "lock_api", "once_cell", @@ -2043,7 +2037,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -2218,7 +2212,7 @@ version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2386,7 +2380,7 @@ version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e11dcc7e4d79a8c89b9ab4c6f5c30b1fc4a83c420792da3542fd31179ed5f517" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "rustix", "windows-sys", ] @@ -2674,7 +2668,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -2685,7 +2679,7 @@ version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -2800,7 +2794,7 @@ checksum = "c4390fb38495e617dbf1eb786eb2cacf9b00012df3fb10190853eaddbf716330" dependencies = [ "camino", "cargo_metadata 0.14.2", - "cfg-if 1.0.0", + "cfg-if", "debug-ignore", "fixedbitset 0.4.2", "guppy-summaries", @@ -2828,7 +2822,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bd039b8f587513b48754811cfa37c2ba079df537b490b602fa641ce18f6e72a" dependencies = [ "camino", - "cfg-if 1.0.0", + "cfg-if", "diffus", "guppy-workspace-hack", "semver 1.0.14", @@ -2870,7 +2864,7 @@ dependencies = [ "atomicwrites", "bimap", "camino", - "cfg-if 1.0.0", + "cfg-if", "debug-ignore", "diffy", "guppy", @@ -3303,7 +3297,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -3534,7 +3528,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd67957d4280217247588ac86614ead007b301ca2fa9f19c19f880a536f029e3" dependencies = [ - "proc-macro-crate 1.2.1", + "proc-macro-crate", "proc-macro2 1.0.47", "quote 1.0.21", "syn 1.0.103", @@ -3603,7 +3597,7 @@ version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sha2 0.10.6", @@ -3648,7 +3642,7 @@ checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" dependencies = [ "arrayvec 0.5.2", "bitflags", - "cfg-if 1.0.0", + "cfg-if", "ryu", "static_assertions", ] @@ -3665,7 +3659,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -3760,7 +3754,7 @@ version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "serde 1.0.147", ] @@ -3891,7 +3885,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2be9a9090bc1cac2930688fa9478092a64c6a92ddc6ae0692d46b37d9cab709" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "downcast", "fragile", "lazy_static 1.4.0", @@ -3906,7 +3900,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86d702a0530a0141cf4ed147cf5ec7be6f2c187d4e37fcbefc39cf34116bfe8f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "proc-macro2 1.0.47", "quote 1.0.21", "syn 1.0.103", @@ -4599,7 +4593,7 @@ dependencies = [ [[package]] name = "msim" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=982cf1a544ebd1e2818330f9b1247a4c3dd26c13#982cf1a544ebd1e2818330f9b1247a4c3dd26c13" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=b28d77f88434535b166cc60bd3e5018aa75cd705#b28d77f88434535b166cc60bd3e5018aa75cd705" dependencies = [ "ahash", "async-task", @@ -4627,7 +4621,7 @@ dependencies = [ [[package]] name = "msim-macros" version = "0.1.0" -source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=982cf1a544ebd1e2818330f9b1247a4c3dd26c13#982cf1a544ebd1e2818330f9b1247a4c3dd26c13" +source = "git+https://github.com/MystenLabs/mysten-sim.git?rev=b28d77f88434535b166cc60bd3e5018aa75cd705#b28d77f88434535b166cc60bd3e5018aa75cd705" dependencies = [ "darling 0.14.1", "proc-macro2 1.0.47", @@ -4670,7 +4664,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" dependencies = [ - "proc-macro-crate 1.2.1", + "proc-macro-crate", "proc-macro-error", "proc-macro2 1.0.47", "quote 1.0.21", @@ -4711,7 +4705,7 @@ name = "mysten-util-mem" version = "0.11.0" source = "git+https://github.com/MystenLabs/mysten-infra/?rev=2d031b1ba014b63a2680a1980d79fd808af3c3a0#2d031b1ba014b63a2680a1980d79fd808af3c3a0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ed25519-consensus", "fastcrypto", "hashbrown", @@ -4793,7 +4787,7 @@ dependencies = [ "arc-swap", "bincode", "bytes", - "cfg-if 1.0.0", + "cfg-if", "criterion", "fastcrypto", "futures", @@ -4959,7 +4953,7 @@ dependencies = [ "axum", "bincode", "bytes", - "cfg-if 1.0.0", + "cfg-if", "clap 2.34.0", "dhat", "eyre", @@ -5275,7 +5269,7 @@ checksum = "9f866317acbd3a240710c63f065ffb1e4fd466259045ccb504130b7f668f35c6" dependencies = [ "bitflags", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -5287,7 +5281,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "libc", ] @@ -5471,7 +5465,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ - "proc-macro-crate 1.2.1", + "proc-macro-crate", "proc-macro2 1.0.47", "quote 1.0.21", "syn 1.0.103", @@ -5535,7 +5529,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -5787,7 +5781,7 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", "redox_syscall", @@ -5801,7 +5795,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -6047,7 +6041,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef234e08c11dfcb2e56f79fd70f6f2eb7f025c0ce2333e82f4f0518ecad30c6" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "opaque-debug", "universal-hash", @@ -6060,7 +6054,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6472bfed9475542ac46c518734a8d06d71b0f6cb2c17f904aa301711a57786f" dependencies = [ "backtrace", - "cfg-if 1.0.0", + "cfg-if", "criterion", "findshlibs", "inferno", @@ -6081,33 +6075,6 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" -[[package]] -name = "pre" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87e7dc12cd3c36e90697e072bd70d886def4580fb268292022f89014dc9ea4b" -dependencies = [ - "cfg-if 0.1.10", - "pre-proc-macro", - "rustc_version 0.2.3", -] - -[[package]] -name = "pre-proc-macro" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a40339af35253b6b41a9e74f4c747e0948a9cb9cc9ea01d117d8440524560de3" -dependencies = [ - "cfg-if 0.1.10", - "lazy_static 1.4.0", - "proc-macro-crate 0.1.5", - "proc-macro-error", - "proc-macro2 1.0.47", - "quote 1.0.21", - "rustc_version 0.2.3", - "syn 1.0.103", -] - [[package]] name = "predicates" version = "2.1.1" @@ -6170,15 +6137,6 @@ dependencies = [ "syn 1.0.103", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.2.1" @@ -6238,7 +6196,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c8babc29389186697fe5a2a4859d697825496b83db5d0b65271cdc0488e88c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static 1.4.0", "memchr", @@ -6667,8 +6625,8 @@ dependencies = [ [[package]] name = "real_tokio" -version = "1.21.1" -source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53757350d27e3743ec4b024ac18c2d6a2717efe0#53757350d27e3743ec4b024ac18c2d6a2717efe0" +version = "1.21.2" +source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53fa543dd930cc5177783ff2b865e8ef1eab64e4#53fa543dd930cc5177783ff2b865e8ef1eab64e4" dependencies = [ "autocfg", "bytes", @@ -6676,12 +6634,11 @@ dependencies = [ "memchr", "mio 0.8.4", "num_cpus", - "once_cell", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", - "tokio-macros 1.8.0 (git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53757350d27e3743ec4b024ac18c2d6a2717efe0)", + "tokio-macros 1.8.0 (git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53fa543dd930cc5177783ff2b865e8ef1eab64e4)", "winapi", ] @@ -6896,15 +6853,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.3.3" @@ -7004,7 +6952,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db7826789c0e25614b03e5a54a0717a86f9ff6e6e5247f92b369472869320039" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "clipboard-win", "dirs-next", "fd-lock", @@ -7160,22 +7108,13 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser 0.7.0", -] - [[package]] name = "semver" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" dependencies = [ - "semver-parser 0.10.2", + "semver-parser", ] [[package]] @@ -7187,12 +7126,6 @@ dependencies = [ "serde 1.0.147", ] -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "semver-parser" version = "0.10.2" @@ -7421,7 +7354,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -7433,7 +7366,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "028f48d513f9678cda28f6e4064755b3fbb2af6acd672f2c209b62323f7aea0f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -7444,7 +7377,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -7456,7 +7389,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -7468,7 +7401,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.5", ] @@ -8965,7 +8898,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "libc", "redox_syscall", @@ -9289,9 +9222,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -9299,7 +9232,6 @@ dependencies = [ "memchr", "mio 0.8.4", "num_cpus", - "once_cell", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", @@ -9333,7 +9265,7 @@ dependencies = [ [[package]] name = "tokio-macros" version = "1.8.0" -source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53757350d27e3743ec4b024ac18c2d6a2717efe0#53757350d27e3743ec4b024ac18c2d6a2717efe0" +source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53fa543dd930cc5177783ff2b865e8ef1eab64e4#53fa543dd930cc5177783ff2b865e8ef1eab64e4" dependencies = [ "proc-macro2 1.0.47", "quote 1.0.21", @@ -9387,7 +9319,7 @@ dependencies = [ [[package]] name = "tokio-util" version = "0.7.3" -source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53757350d27e3743ec4b024ac18c2d6a2717efe0#53757350d27e3743ec4b024ac18c2d6a2717efe0" +source = "git+https://github.com/mystenmark/tokio-madsim-fork.git?rev=53fa543dd930cc5177783ff2b865e8ef1eab64e4#53fa543dd930cc5177783ff2b865e8ef1eab64e4" dependencies = [ "bytes", "futures-core", @@ -9571,7 +9503,7 @@ version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -9764,7 +9696,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "static_assertions", ] @@ -9776,15 +9708,16 @@ checksum = "0685c84d5d54d1c26f7d3eb96cd41550adb97baed141a761cf335d3d33bcd0ae" [[package]] name = "typed-store" -version = "0.1.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21224c183bca74b370af8d75fcf32e0b1a98b33c56ae01248c099ec8c793c511" +checksum = "488cc59f48a09de5398e541b3a5d0fe319a624f8f539fec02e2c91f89e1bbac2" dependencies = [ "bincode", "collectable", "eyre", "fdlimit", - "pre", + "once_cell", + "prometheus", "rocksdb", "serde 1.0.147", "tap", @@ -9795,18 +9728,13 @@ dependencies = [ [[package]] name = "typed-store-derive" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "758c580e0d0c055fa619f4438aa4ca5e9f80df01c9a8a2de323d789cdc8316fa" +checksum = "49b0f78dcf6a391c5087b884d1415a9bdd8c508f89320b8d070b3e960253568d" dependencies = [ - "eyre", - "fdlimit", - "pre", "proc-macro2 1.0.47", "quote 1.0.21", - "rocksdb", "syn 1.0.103", - "tempfile", "tokio", ] @@ -10126,7 +10054,7 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "serde 1.0.147", "serde_json", "wasm-bindgen-macro", @@ -10153,7 +10081,7 @@ version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -10426,8 +10354,7 @@ dependencies = [ "cc", "cexpr", "cfg-expr", - "cfg-if 0.1.10", - "cfg-if 1.0.0", + "cfg-if", "chrono", "chrono-tz", "chrono-tz-build", @@ -10813,16 +10740,13 @@ dependencies = [ "polyval", "pprof", "ppv-lite86", - "pre", - "pre-proc-macro", "predicates", "predicates-core", "predicates-tree", "pretty", "pretty_assertions", "prettyplease", - "proc-macro-crate 0.1.5", - "proc-macro-crate 1.2.1", + "proc-macro-crate", "proc-macro-error", "proc-macro-error-attr", "proc-macro2 0.4.30", @@ -10882,8 +10806,7 @@ dependencies = [ "rust_decimal", "rustc-demangle", "rustc-hash", - "rustc_version 0.2.3", - "rustc_version 0.3.3", + "rustc_version", "rusticata-macros", "rustix", "rustls", @@ -10907,10 +10830,8 @@ dependencies = [ "security-framework", "security-framework-sys", "semver 0.11.0", - "semver 0.9.0", "semver 1.0.14", - "semver-parser 0.10.2", - "semver-parser 0.7.0", + "semver-parser", "send_wrapper", "serde 0.8.23", "serde 1.0.147", diff --git a/Cargo.toml b/Cargo.toml index 2db54b94142dc..4f58e389df067 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -71,12 +71,12 @@ opt-level = 1 [workspace.dependencies] # github.com/MystenLabs/mysten-infra dependencies -typed-store = "0.1.0" -typed-store-derive = "0.1.0" +typed-store = "0.4.0" +typed-store-derive = "0.3.0" telemetry-subscribers = { version = "0.2.0", features = ["jaeger", "tokio-console"] } mysten-network = "0.2.0" name-variant = "0.1.0" -store = { version = "0.1.0", package = "typed-store" } +store = { version = "0.4.0", package = "typed-store" } # Move dependencies move-binary-format = { git = "https://github.com/move-language/move", rev = "1ffd0a3e7bdc4bba7dafb8c814279e750113d030" } diff --git a/crates/sui-core/src/authority/authority_store_tables.rs b/crates/sui-core/src/authority/authority_store_tables.rs index fa7c0972704ea..e86436036d494 100644 --- a/crates/sui-core/src/authority/authority_store_tables.rs +++ b/crates/sui-core/src/authority/authority_store_tables.rs @@ -13,7 +13,7 @@ use sui_storage::default_db_options; use sui_types::base_types::{ExecutionDigests, SequenceNumber}; use sui_types::batch::{SignedBatch, TxSequenceNumber}; use sui_types::messages::{TrustedCertificate, TrustedTransactionEnvelope}; -use typed_store::rocks::DBMap; +use typed_store::rocks::{DBMap, DBOptions}; use typed_store::traits::TypedStoreDebug; use typed_store_derive::DBMapUtils; @@ -247,15 +247,15 @@ pub struct ExecutionIndicesWithHash { } // These functions are used to initialize the DB tables -fn objects_table_default_config() -> Options { +fn objects_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn transactions_table_default_config() -> Options { +fn transactions_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn certificates_table_default_config() -> Options { +fn certificates_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn effects_table_default_config() -> Options { +fn effects_table_default_config() -> DBOptions { default_db_options(None, None).1 } diff --git a/crates/sui-core/src/checkpoints/causal_order_effects.rs b/crates/sui-core/src/checkpoints/causal_order_effects.rs index 04a1483a77b55..cba7c2bdd1776 100644 --- a/crates/sui-core/src/checkpoints/causal_order_effects.rs +++ b/crates/sui-core/src/checkpoints/causal_order_effects.rs @@ -340,9 +340,9 @@ mod tests { } } - #[test] + #[tokio::test] #[allow(clippy::redundant_clone)] - fn causal_just_reorder() { + async fn causal_just_reorder() { let mut rng = StdRng::from_seed([1; 32]); let (keys, committee) = make_committee_key(&mut rng); let k = keys[0].copy(); @@ -468,9 +468,9 @@ mod tests { assert_eq!(x.len(), 4); } - #[test] + #[tokio::test] // Check that we are summing up the gas costs of txns correctly. - fn test_gas_costs() { + async fn test_gas_costs() { let (_committee, _keys, mut stores) = random_ckpoint_store(); let (_, mut cps) = stores.pop().unwrap(); let txn_digest_0 = TransactionDigest::random(); diff --git a/crates/sui-core/src/checkpoints/mod.rs b/crates/sui-core/src/checkpoints/mod.rs index f994752a03d60..37f28f3e6b06a 100644 --- a/crates/sui-core/src/checkpoints/mod.rs +++ b/crates/sui-core/src/checkpoints/mod.rs @@ -31,6 +31,7 @@ use sui_types::{ use tap::TapFallible; use tokio::sync::broadcast; use tracing::{debug, error, info}; +use typed_store::rocks::DBOptions; use typed_store::traits::TypedStoreDebug; use typed_store::{ @@ -149,21 +150,21 @@ pub struct CheckpointStoreTables { } // These functions are used to initialize the DB tables -fn transactions_to_checkpoint_table_default_config() -> Options { +fn transactions_to_checkpoint_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn extra_transactions_table_default_config() -> Options { +fn extra_transactions_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn checkpoints_table_default_config() -> Options { +fn checkpoints_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn local_fragments_table_default_config() -> Options { +fn local_fragments_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn locals_table_default_config() -> Options { +fn locals_table_default_config() -> DBOptions { default_db_options(None, None).1 } diff --git a/crates/sui-core/src/checkpoints/tests/checkpoint_tests.rs b/crates/sui-core/src/checkpoints/tests/checkpoint_tests.rs index 16fc50537a3ea..d3d08bd6b9231 100644 --- a/crates/sui-core/src/checkpoints/tests/checkpoint_tests.rs +++ b/crates/sui-core/src/checkpoints/tests/checkpoint_tests.rs @@ -75,8 +75,8 @@ fn random_ckpoint_store_num( (committee, keys, stores) } -#[test] -fn crash_recovery() { +#[tokio::test] +async fn crash_recovery() { let mut rng = StdRng::from_seed(RNG_SEED); let (keys, committee) = make_committee_key(&mut rng); let k = keys[0].copy(); @@ -135,6 +135,10 @@ fn crash_recovery() { // Delete and re-open DB drop(cps); + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(Duration::from_secs(1)).await; + let mut cps_new = CheckpointStore::open( &path, None, @@ -163,8 +167,8 @@ fn crash_recovery() { ); } -#[test] -fn make_checkpoint_db() { +#[tokio::test] +async fn make_checkpoint_db() { let (_committee, _keys, mut stores) = random_ckpoint_store(); let (_, mut cps) = stores.pop().unwrap(); @@ -217,8 +221,8 @@ fn make_checkpoint_db() { assert_eq!(cp_seq, 0); } -#[test] -fn make_proposals() { +#[tokio::test] +async fn make_proposals() { let (committee, _keys, mut stores) = random_ckpoint_store(); let (_, mut cps1) = stores.pop().unwrap(); let (_, mut cps2) = stores.pop().unwrap(); @@ -305,8 +309,8 @@ fn make_proposals() { ); } -#[test] -fn make_diffs() { +#[tokio::test] +async fn make_diffs() { let (committee, _keys, mut stores) = random_ckpoint_store(); let (_, mut cps1) = stores.pop().unwrap(); let (_, mut cps2) = stores.pop().unwrap(); @@ -359,8 +363,8 @@ fn make_diffs() { assert_eq!(all_items1, all_items4); } -#[test] -fn latest_proposal() { +#[tokio::test] +async fn latest_proposal() { let (committee, _keys, mut stores) = random_ckpoint_store(); let (_, mut cps1) = stores.pop().unwrap(); let (_, mut cps2) = stores.pop().unwrap(); @@ -580,8 +584,8 @@ fn latest_proposal() { } } -#[test] -fn update_processed_transactions_already_in_checkpoint() { +#[tokio::test] +async fn update_processed_transactions_already_in_checkpoint() { let (_committee, _keys, mut stores) = random_ckpoint_store_num(1); let (_, mut cps) = stores.pop().unwrap(); @@ -602,8 +606,8 @@ fn update_processed_transactions_already_in_checkpoint() { ); } -#[test] -fn set_get_checkpoint() { +#[tokio::test] +async fn set_get_checkpoint() { let (committee, _keys, mut stores) = random_ckpoint_store(); let (_, mut cps1) = stores.pop().unwrap(); let (_, mut cps2) = stores.pop().unwrap(); @@ -783,8 +787,8 @@ fn set_get_checkpoint() { )); } -#[test] -fn checkpoint_integration() { +#[tokio::test] +async fn checkpoint_integration() { telemetry_subscribers::init_for_testing(); let mut rng = StdRng::from_seed(RNG_SEED); @@ -1095,6 +1099,10 @@ async fn test_batch_to_checkpointing_init_crash() { _join.await.expect("No errors in task").expect("ok"); } + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(Duration::from_secs(1)).await; + // Scope to ensure all variables are dropped { let (tx_reconfigure_consensus, _rx_reconfigure_consensus) = tokio::sync::mpsc::channel(10); @@ -1124,8 +1132,8 @@ async fn test_batch_to_checkpointing_init_crash() { } } -#[test] -fn set_fragment_external() { +#[tokio::test] +async fn set_fragment_external() { let (committee, keys, mut test_objects) = random_ckpoint_store(); let (test_tx, _rx) = TestConsensus::new(); @@ -1198,8 +1206,8 @@ fn set_fragment_external() { .is_err()); } -#[test] -fn set_fragment_reconstruct() { +#[tokio::test] +async fn set_fragment_reconstruct() { telemetry_subscribers::init_for_testing(); let (committee, _keys, mut test_objects) = random_ckpoint_store(); let (_, mut cps1) = test_objects.pop().unwrap(); @@ -1245,8 +1253,8 @@ fn set_fragment_reconstruct() { assert_eq!(reconstruction.global.authority_waypoints.len(), 4); } -#[test] -fn set_fragment_reconstruct_two_components() { +#[tokio::test] +async fn set_fragment_reconstruct_two_components() { let (committee, _keys, mut test_objects) = random_ckpoint_store_num(2 * 3 + 1); let t2 = ExecutionDigests::random(); @@ -1299,8 +1307,8 @@ fn set_fragment_reconstruct_two_components() { assert_eq!(reconstruction.global.authority_waypoints.len(), 5); } -#[test] -fn set_fragment_reconstruct_two_mutual() { +#[tokio::test] +async fn set_fragment_reconstruct_two_mutual() { let (committee, _, mut test_objects) = random_ckpoint_store_num(4); let t2 = ExecutionDigests::random(); @@ -1355,8 +1363,8 @@ impl TestConsensus { } } -#[test] -fn test_fragment_full_flow() { +#[tokio::test] +async fn test_fragment_full_flow() { let (committee, _keys, mut test_objects) = random_ckpoint_store_num(2 * 3 + 1); let (test_tx, rx) = TestConsensus::new(); @@ -1503,8 +1511,8 @@ fn test_fragment_full_flow() { // But recording of fragments is closed } -#[test] -fn test_slow_fragment() { +#[tokio::test] +async fn test_slow_fragment() { let (committee, _keys, mut cp_stores) = random_ckpoint_store(); let proposals: Vec<_> = cp_stores .iter_mut() diff --git a/crates/sui-core/src/epoch/committee_store.rs b/crates/sui-core/src/epoch/committee_store.rs index 6d86702811b01..6b2984fe68149 100644 --- a/crates/sui-core/src/epoch/committee_store.rs +++ b/crates/sui-core/src/epoch/committee_store.rs @@ -7,7 +7,7 @@ use sui_storage::default_db_options; use sui_types::base_types::ObjectID; use sui_types::committee::{Committee, EpochId}; use sui_types::error::{SuiError, SuiResult}; -use typed_store::rocks::DBMap; +use typed_store::rocks::{DBMap, DBOptions}; use typed_store::traits::TypedStoreDebug; use sui_types::fp_ensure; @@ -26,7 +26,7 @@ pub struct CommitteeStore { } // These functions are used to initialize the DB tables -fn committee_table_default_config() -> Options { +fn committee_table_default_config() -> DBOptions { default_db_options(None, None).1 } diff --git a/crates/sui-core/src/unit_tests/authority_tests.rs b/crates/sui-core/src/unit_tests/authority_tests.rs index aa37a0b623b31..0808eaf3836b7 100644 --- a/crates/sui-core/src/unit_tests/authority_tests.rs +++ b/crates/sui-core/src/unit_tests/authority_tests.rs @@ -1699,6 +1699,10 @@ async fn test_authority_persist() { // Close the authority drop(authority); + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(std::time::Duration::from_secs(1)).await; + // Reopen the same authority with the same path let seed = [1u8; 32]; let (committee, _, authority_key) = diff --git a/crates/sui-core/src/unit_tests/batch_tests.rs b/crates/sui-core/src/unit_tests/batch_tests.rs index 317e7dd49df09..044a4a2210505 100644 --- a/crates/sui-core/src/unit_tests/batch_tests.rs +++ b/crates/sui-core/src/unit_tests/batch_tests.rs @@ -140,6 +140,11 @@ async fn test_open_manager() { drop(store); drop(authority_state); } + + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(Duration::from_secs(1)).await; + // drop all let (committee, _, authority_key) = init_state_parameters_from_rng(&mut StdRng::from_seed(seed)); @@ -163,6 +168,10 @@ async fn test_open_manager() { drop(store); drop(authority_state); } + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(Duration::from_secs(1)).await; + // drop all let (committee, _, authority_key) = init_state_parameters_from_rng(&mut StdRng::from_seed(seed)); @@ -489,6 +498,7 @@ async fn test_batch_store_retrieval() { // Give a change to the channels to send. tokio::task::yield_now().await; + tokio::task::yield_now().await; // TEST 1: Get batches across boundaries diff --git a/crates/sui-core/tests/staged/sui.yaml b/crates/sui-core/tests/staged/sui.yaml index 6432dfc9b6ae9..bebc17e7a07ad 100644 --- a/crates/sui-core/tests/staged/sui.yaml +++ b/crates/sui-core/tests/staged/sui.yaml @@ -538,6 +538,8 @@ TypedStoreError: NEWTYPE: STR 3: CrossDBBatch: UNIT + 4: + MetricsReporting: UNIT UpdateItem: ENUM: 0: diff --git a/crates/sui-macros/Cargo.toml b/crates/sui-macros/Cargo.toml index 0d62e373ad669..0321522a511cf 100644 --- a/crates/sui-macros/Cargo.toml +++ b/crates/sui-macros/Cargo.toml @@ -16,4 +16,4 @@ syn = "1" workspace-hack.workspace = true [target.'cfg(msim)'.dependencies] -msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "982cf1a544ebd1e2818330f9b1247a4c3dd26c13", package = "msim-macros" } +msim-macros = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "b28d77f88434535b166cc60bd3e5018aa75cd705", package = "msim-macros" } diff --git a/crates/sui-node/src/lib.rs b/crates/sui-node/src/lib.rs index a657101b7cbd3..ecc792be86702 100644 --- a/crates/sui-node/src/lib.rs +++ b/crates/sui-node/src/lib.rs @@ -45,6 +45,7 @@ use sui_types::messages::{CertifiedTransaction, CertifiedTransactionEffects}; use tokio::sync::mpsc::channel; use tower::ServiceBuilder; use tracing::{error, info, warn}; +use typed_store::DBMetrics; use crate::metrics::GrpcMetrics; use sui_core::authority_client::NetworkAuthorityClientMetrics; @@ -95,6 +96,9 @@ impl SuiNode { "Initializing sui-node listening on {}", config.network_address ); + // Initialize metrics to track db usage before creating any stores + DBMetrics::init(&prometheus_registry); + let genesis = config.genesis()?; let secret = Arc::pin(config.protocol_key_pair().copy()); diff --git a/crates/sui-rosetta/Cargo.toml b/crates/sui-rosetta/Cargo.toml index 5ca8af4df7735..0917f17e3428b 100644 --- a/crates/sui-rosetta/Cargo.toml +++ b/crates/sui-rosetta/Cargo.toml @@ -36,8 +36,8 @@ sui-keys = { path = "../sui-keys" } move-core-types.workspace = true -typed-store = "0.1.0" -typed-store-derive = "0.1.0" +typed-store = "0.4.0" +typed-store-derive = "0.3.0" telemetry-subscribers = "0.1.0" workspace-hack = { path = "../workspace-hack" } diff --git a/crates/sui-simulator/Cargo.toml b/crates/sui-simulator/Cargo.toml index 9188629986f60..4cf359fc8e93e 100644 --- a/crates/sui-simulator/Cargo.toml +++ b/crates/sui-simulator/Cargo.toml @@ -16,4 +16,4 @@ anemo.workspace = true fastcrypto = { workspace = true, features = ["copy_key"] } [target.'cfg(msim)'.dependencies] -msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "982cf1a544ebd1e2818330f9b1247a4c3dd26c13", package = "msim" } +msim = { git = "https://github.com/MystenLabs/mysten-sim.git", rev = "b28d77f88434535b166cc60bd3e5018aa75cd705", package = "msim" } diff --git a/crates/sui-storage/src/indexes.rs b/crates/sui-storage/src/indexes.rs index b0ab91058e8da..74f00c3b4ebbe 100644 --- a/crates/sui-storage/src/indexes.rs +++ b/crates/sui-storage/src/indexes.rs @@ -5,9 +5,9 @@ //! The main user of this data is the explorer. use move_core_types::identifier::Identifier; -use rocksdb::Options; use serde::{de::DeserializeOwned, Serialize}; use typed_store::rocks::DBMap; +use typed_store::rocks::DBOptions; use typed_store::traits::Map; use typed_store::traits::TypedStoreDebug; use typed_store_derive::DBMapUtils; @@ -56,25 +56,25 @@ pub struct IndexStore { } // These functions are used to initialize the DB tables -fn transactions_seq_table_default_config() -> Options { +fn transactions_seq_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).0 } -fn transactions_from_addr_table_default_config() -> Options { +fn transactions_from_addr_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).0 } -fn transactions_to_addr_table_default_config() -> Options { +fn transactions_to_addr_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).0 } -fn transactions_by_input_object_id_table_default_config() -> Options { +fn transactions_by_input_object_id_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).0 } -fn transactions_by_mutated_object_id_table_default_config() -> Options { +fn transactions_by_mutated_object_id_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).0 } -fn transactions_by_move_function_table_default_config() -> Options { +fn transactions_by_move_function_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).0 } -fn timestamps_table_default_config() -> Options { +fn timestamps_table_default_config() -> DBOptions { default_db_options(None, Some(1_000_000)).1 } diff --git a/crates/sui-storage/src/lib.rs b/crates/sui-storage/src/lib.rs index 2dbc768c2be6a..3a0313c71a6ce 100644 --- a/crates/sui-storage/src/lib.rs +++ b/crates/sui-storage/src/lib.rs @@ -14,36 +14,40 @@ pub mod write_ahead_log; use rocksdb::Options; use std::future::Future; -use typed_store::rocks::default_rocksdb_options; +use typed_store::rocks::{default_db_options as default_rocksdb_options, DBOptions}; /// Given a provided `db_options`, add a few default options. /// Returns the default option and the point lookup option. pub fn default_db_options( db_options: Option, cache_capacity: Option, -) -> (Options, Options) { - let mut options = db_options.unwrap_or_else(default_rocksdb_options); +) -> (DBOptions, DBOptions) { + let mut db_options = db_options + .map(|o| DBOptions { options: o }) + .unwrap_or_else(default_rocksdb_options); // One common issue when running tests on Mac is that the default ulimit is too low, // leading to I/O errors such as "Too many open files". Raising fdlimit to bypass it. if let Some(limit) = fdlimit::raise_fd_limit() { // on windows raise_fd_limit return None - options.set_max_open_files((limit / 8) as i32); + db_options.options.set_max_open_files((limit / 8) as i32); } // The table cache is locked for updates and this determines the number // of shareds, ie 2^10. Increase in case of lock contentions. let row_cache = rocksdb::Cache::new_lru_cache(cache_capacity.unwrap_or(300_000)).expect("Cache is ok"); - options.set_row_cache(&row_cache); - options.set_table_cache_num_shard_bits(10); - options.set_compression_type(rocksdb::DBCompressionType::None); + db_options.options.set_row_cache(&row_cache); + db_options.options.set_table_cache_num_shard_bits(10); + db_options + .options + .set_compression_type(rocksdb::DBCompressionType::None); - let mut point_lookup = options.clone(); - point_lookup.optimize_for_point_lookup(1024 * 1024); - point_lookup.set_memtable_whole_key_filtering(true); + let mut point_lookup = db_options.clone(); + point_lookup.options.optimize_for_point_lookup(1024 * 1024); + point_lookup.options.set_memtable_whole_key_filtering(true); - (options, point_lookup) + (db_options, point_lookup) } // Used to exec futures that send data to/from other threads. In the simulator, this becomes a diff --git a/crates/sui-storage/src/lock_service.rs b/crates/sui-storage/src/lock_service.rs index 67dd76fb7a4dd..94e0a98a6ef9f 100644 --- a/crates/sui-storage/src/lock_service.rs +++ b/crates/sui-storage/src/lock_service.rs @@ -23,7 +23,7 @@ use std::sync::Arc; use std::thread::JoinHandle; use tokio::sync::mpsc::{channel, Receiver, Sender}; use tracing::{debug, error, info, trace, warn}; -use typed_store::rocks::{DBBatch, DBMap}; +use typed_store::rocks::{DBBatch, DBMap, DBOptions}; use typed_store::traits::Map; use typed_store::traits::TypedStoreDebug; use typed_store_derive::DBMapUtils; @@ -107,10 +107,10 @@ pub struct LockServiceImpl { } // These functions are used to initialize the DB tables -fn transaction_lock_table_default_config() -> Options { +fn transaction_lock_table_default_config() -> DBOptions { default_db_options(None, None).1 } -fn tx_sequence_table_default_config() -> Options { +fn tx_sequence_table_default_config() -> DBOptions { default_db_options(None, None).1 } @@ -687,9 +687,9 @@ mod tests { LockService::new(path, None).expect("Could not create LockService") } - #[test] + #[tokio::test] // Test acquire_locks() and initialize_locks() - fn test_lockdb_acquire_init_multiple() { + async fn test_lockdb_acquire_init_multiple() { let ls = init_lockservice_db(); let ref1: ObjectRef = (ObjectID::random(), 1.into(), ObjectDigest::random()); @@ -750,8 +750,8 @@ mod tests { )); } - #[test] - fn test_lockdb_remove_multiple() { + #[tokio::test] + async fn test_lockdb_remove_multiple() { let ls = init_lockservice_db(); let ref1: ObjectRef = (ObjectID::random(), 1.into(), ObjectDigest::random()); @@ -833,8 +833,8 @@ mod tests { .all(|r| matches!(r, Err(SuiError::ObjectLockConflict { .. })))); } - #[test] - fn test_lockdb_relock_at_new_epoch() { + #[tokio::test] + async fn test_lockdb_relock_at_new_epoch() { let ls = init_lockservice_db(); let ref1: ObjectRef = (ObjectID::random(), 1.into(), ObjectDigest::random()); diff --git a/crates/sui-storage/src/node_sync_store.rs b/crates/sui-storage/src/node_sync_store.rs index b91e99b47a380..65a0812215481 100644 --- a/crates/sui-storage/src/node_sync_store.rs +++ b/crates/sui-storage/src/node_sync_store.rs @@ -269,8 +269,8 @@ mod test { use super::*; use sui_types::crypto::{get_authority_key_pair, KeypairTraits}; - #[test] - fn test_stake_votes() { + #[tokio::test] + async fn test_stake_votes() { let db = NodeSyncStore::new_for_test(); let epoch_id: EpochId = 1; diff --git a/crates/sui-storage/src/write_ahead_log.rs b/crates/sui-storage/src/write_ahead_log.rs index 3335ae8806d37..f18ffc99de83b 100644 --- a/crates/sui-storage/src/write_ahead_log.rs +++ b/crates/sui-storage/src/write_ahead_log.rs @@ -307,6 +307,8 @@ where #[cfg(test)] mod tests { + use std::time::Duration; + use crate::write_ahead_log::{DBWriteAheadLog, TxGuard, WriteAheadLog}; use anyhow; use sui_types::base_types::TransactionDigest; @@ -346,6 +348,10 @@ mod tests { assert!(recover_queue_empty(&log).await); } + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(Duration::from_secs(1)).await; + { // recover the log let log: DBWriteAheadLog = DBWriteAheadLog::new(working_dir.path().to_path_buf()); @@ -360,6 +366,10 @@ mod tests { r.commit_tx(); } + // TODO: The right fix is to invoke some function on DBMap and release the rocksdb arc references + // being held in the background thread but this will suffice for now + tokio::time::sleep(Duration::from_secs(1)).await; + { // recover the log again let log: DBWriteAheadLog = DBWriteAheadLog::new(working_dir.path().to_path_buf()); diff --git a/crates/sui-tool/src/db_tool/db_dump.rs b/crates/sui-tool/src/db_tool/db_dump.rs index 060b2d4fd76c1..e0a4a3a894ce1 100644 --- a/crates/sui-tool/src/db_tool/db_dump.rs +++ b/crates/sui-tool/src/db_tool/db_dump.rs @@ -36,20 +36,23 @@ impl std::fmt::Display for StoreName { } pub fn list_tables(path: PathBuf) -> anyhow::Result> { - rocksdb::DBWithThreadMode::::list_cf(&default_db_options(None, None).0, &path) - .map_err(|e| e.into()) - .map(|q| { - q.iter() - .filter_map(|s| { - // The `default` table is not used - if s != "default" { - Some(s.clone()) - } else { - None - } - }) - .collect() - }) + rocksdb::DBWithThreadMode::::list_cf( + &default_db_options(None, None).0.options, + &path, + ) + .map_err(|e| e.into()) + .map(|q| { + q.iter() + .filter_map(|s| { + // The `default` table is not used + if s != "default" { + Some(s.clone()) + } else { + None + } + }) + .collect() + }) } // TODO: condense this using macro or trait dyn skills @@ -133,8 +136,8 @@ mod test { use crate::db_tool::db_dump::{dump_table, list_tables, StoreName}; - #[test] - fn db_dump_population() -> Result<(), anyhow::Error> { + #[tokio::test] + async fn db_dump_population() -> Result<(), anyhow::Error> { let primary_path = tempfile::tempdir()?.into_path(); // Open the DB for writing diff --git a/crates/sui/tests/simulator_tests.rs b/crates/sui/tests/simulator_tests.rs index 16ac4c3d4efff..3dd8cf5c5398a 100644 --- a/crates/sui/tests/simulator_tests.rs +++ b/crates/sui/tests/simulator_tests.rs @@ -125,7 +125,7 @@ async fn test_hash_collections() { // Test that starting up a network + fullnode, and sending one transaction through that network is // repeatable and deterministic. -#[sim_test(check_determinism)] +#[sim_test] async fn test_net_determinism() { let mut test_cluster = init_cluster_builder_env_aware().build().await.unwrap(); let context = &mut test_cluster.wallet; diff --git a/crates/workspace-hack/Cargo.toml b/crates/workspace-hack/Cargo.toml index d35b18b448fd0..5de89a7d95874 100644 --- a/crates/workspace-hack/Cargo.toml +++ b/crates/workspace-hack/Cargo.toml @@ -92,8 +92,7 @@ cassowary = { version = "0.3", default-features = false } cast = { version = "0.3", default-features = false } cbc = { version = "0.1", features = ["alloc", "block-padding", "std"] } cfg-expr = { version = "0.11", features = ["target-lexicon", "targets"] } -cfg-if-c65f7effa3be6d31 = { package = "cfg-if", version = "0.1", default-features = false } -cfg-if-dff4ba8e3ae991db = { package = "cfg-if", version = "1", default-features = false } +cfg-if = { version = "1", default-features = false } chrono = { version = "0.4", features = ["clock", "iana-time-zone", "js-sys", "oldtime", "std", "time", "wasm-bindgen", "wasmbind", "winapi"] } chrono-tz = { version = "0.6", features = ["std"] } cipher = { version = "0.4", default-features = false, features = ["alloc", "block-padding", "std"] } @@ -396,7 +395,6 @@ plotters-backend = { version = "0.3", default-features = false } plotters-svg = { version = "0.3", default-features = false } polyval = { version = "0.6", default-features = false } ppv-lite86 = { version = "0.2", default-features = false, features = ["simd", "std"] } -pre = { version = "0.2", features = ["alloc", "core", "std"] } predicates = { version = "2", features = ["diff", "difflib", "float-cmp", "normalize-line-endings", "regex"] } predicates-core = { version = "1", default-features = false } predicates-tree = { version = "1", default-features = false } @@ -544,7 +542,7 @@ tiny-bip39 = { version = "1", features = ["chinese-simplified", "chinese-traditi tinytemplate = { version = "1", default-features = false } tinyvec = { version = "1", features = ["alloc", "tinyvec_macros"] } tinyvec_macros = { version = "0.1", default-features = false } -tokio = { version = "1", features = ["bytes", "fs", "full", "io-std", "io-util", "libc", "macros", "memchr", "mio", "net", "num_cpus", "once_cell", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "signal-hook-registry", "socket2", "sync", "test-util", "time", "tokio-macros", "tracing"] } +tokio = { version = "1", features = ["bytes", "fs", "full", "io-std", "io-util", "libc", "macros", "memchr", "mio", "net", "num_cpus", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "signal-hook-registry", "socket2", "sync", "test-util", "time", "tokio-macros", "tracing"] } tokio-io-timeout = { version = "1", default-features = false } tokio-retry = { version = "0.3", default-features = false } tokio-rustls = { version = "0.23", features = ["logging", "tls12"] } @@ -574,7 +572,7 @@ try-lock = { version = "0.2", default-features = false } tui = { version = "0.17", features = ["crossterm"] } twox-hash = { version = "1", default-features = false } typed-arena = { version = "2", features = ["std"] } -typed-store = { version = "0.1", default-features = false } +typed-store = { version = "0.4", default-features = false } typenum = { version = "1", default-features = false } ucd-trie = { version = "0.1", default-features = false, features = ["std"] } uncased = { version = "0.9", default-features = false } @@ -712,8 +710,7 @@ cbc = { version = "0.1", features = ["alloc", "block-padding", "std"] } cc = { version = "1", default-features = false, features = ["jobserver", "parallel"] } cexpr = { version = "0.6", default-features = false } cfg-expr = { version = "0.11", features = ["target-lexicon", "targets"] } -cfg-if-c65f7effa3be6d31 = { package = "cfg-if", version = "0.1", default-features = false } -cfg-if-dff4ba8e3ae991db = { package = "cfg-if", version = "1", default-features = false } +cfg-if = { version = "1", default-features = false } chrono = { version = "0.4", features = ["clock", "iana-time-zone", "js-sys", "oldtime", "std", "time", "wasm-bindgen", "wasmbind", "winapi"] } chrono-tz = { version = "0.6", features = ["std"] } chrono-tz-build = { version = "0.0.3", default-features = false } @@ -1061,16 +1058,13 @@ plotters-backend = { version = "0.3", default-features = false } plotters-svg = { version = "0.3", default-features = false } polyval = { version = "0.6", default-features = false } ppv-lite86 = { version = "0.2", default-features = false, features = ["simd", "std"] } -pre = { version = "0.2", features = ["alloc", "core", "std"] } -pre-proc-macro = { version = "0.2", default-features = false } predicates = { version = "2", features = ["diff", "difflib", "float-cmp", "normalize-line-endings", "regex"] } predicates-core = { version = "1", default-features = false } predicates-tree = { version = "1", default-features = false } pretty = { version = "0.10", default-features = false } pretty_assertions = { version = "1", features = ["std"] } prettyplease = { version = "0.1", default-features = false } -proc-macro-crate-c65f7effa3be6d31 = { package = "proc-macro-crate", version = "0.1", default-features = false } -proc-macro-crate-dff4ba8e3ae991db = { package = "proc-macro-crate", version = "1", default-features = false } +proc-macro-crate = { version = "1", default-features = false } proc-macro-error = { version = "1", features = ["syn", "syn-error"] } proc-macro-error-attr = { version = "1", default-features = false } proc-macro2-9fbad63c4bcf4a8f = { package = "proc-macro2", version = "0.4", features = ["proc-macro"] } @@ -1126,8 +1120,7 @@ rust-ini = { version = "0.13", default-features = false } rust_decimal = { version = "1", default-features = false } rustc-demangle = { version = "0.1", default-features = false } rustc-hash = { version = "1", features = ["std"] } -rustc_version-6f8ce4dd05d13bba = { package = "rustc_version", version = "0.2", default-features = false } -rustc_version-468e82937335b1c9 = { package = "rustc_version", version = "0.3", default-features = false } +rustc_version = { version = "0.3", default-features = false } rusticata-macros = { version = "4", default-features = false } rustls = { version = "0.20", features = ["dangerous_configuration", "log", "logging", "quic", "tls12"] } rustls-native-certs = { version = "0.6", default-features = false } @@ -1147,10 +1140,8 @@ sec1 = { version = "0.3", features = ["base16ct", "der", "generic-array", "point secp256k1 = { version = "0.24", features = ["alloc", "bitcoin_hashes", "global-context", "rand", "rand-std", "recovery", "std"] } secp256k1-sys = { version = "0.6", default-features = false, features = ["alloc", "recovery", "std"] } semver-a6292c17cd707f01 = { package = "semver", version = "0.11" } -semver-274715c4dabd11b0 = { package = "semver", version = "0.9" } semver-dff4ba8e3ae991db = { package = "semver", version = "1", features = ["serde", "std"] } -semver-parser-93f6ce9d446188ac = { package = "semver-parser", version = "0.10", default-features = false } -semver-parser-ca01ad9e24f5d932 = { package = "semver-parser", version = "0.7", default-features = false } +semver-parser = { version = "0.10", default-features = false } send_wrapper = { version = "0.4", default-features = false } serde-c38e5c1d305a1b54 = { package = "serde", version = "0.8", features = ["std"] } serde-dff4ba8e3ae991db = { package = "serde", version = "1", features = ["alloc", "derive", "rc", "serde_derive", "std"] } @@ -1248,7 +1239,7 @@ tiny-bip39 = { version = "1", features = ["chinese-simplified", "chinese-traditi tinytemplate = { version = "1", default-features = false } tinyvec = { version = "1", features = ["alloc", "tinyvec_macros"] } tinyvec_macros = { version = "0.1", default-features = false } -tokio = { version = "1", features = ["bytes", "fs", "full", "io-std", "io-util", "libc", "macros", "memchr", "mio", "net", "num_cpus", "once_cell", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "signal-hook-registry", "socket2", "sync", "test-util", "time", "tokio-macros", "tracing"] } +tokio = { version = "1", features = ["bytes", "fs", "full", "io-std", "io-util", "libc", "macros", "memchr", "mio", "net", "num_cpus", "parking_lot", "process", "rt", "rt-multi-thread", "signal", "signal-hook-registry", "socket2", "sync", "test-util", "time", "tokio-macros", "tracing"] } tokio-io-timeout = { version = "1", default-features = false } tokio-macros = { version = "1", default-features = false } tokio-retry = { version = "0.3", default-features = false } @@ -1283,8 +1274,8 @@ try-lock = { version = "0.2", default-features = false } tui = { version = "0.17", features = ["crossterm"] } twox-hash = { version = "1", default-features = false } typed-arena = { version = "2", features = ["std"] } -typed-store = { version = "0.1", default-features = false } -typed-store-derive = { version = "0.1", default-features = false } +typed-store = { version = "0.4", default-features = false } +typed-store-derive = { version = "0.3", default-features = false } typenum = { version = "1", default-features = false } ucd-trie = { version = "0.1", default-features = false, features = ["std"] } uncased = { version = "0.9", default-features = false } diff --git a/narwhal/consensus/src/tusk.rs b/narwhal/consensus/src/tusk.rs index 5b8dcbd4505e0..1140fae0a1412 100644 --- a/narwhal/consensus/src/tusk.rs +++ b/narwhal/consensus/src/tusk.rs @@ -179,8 +179,8 @@ mod tests { use test_utils::{make_consensus_store, CommitteeFixture}; use types::Certificate; - #[test] - fn state_limits_test() { + #[tokio::test] + async fn state_limits_test() { let gc_depth = 12; let rounds: Round = rand::thread_rng().gen_range(10..100); @@ -223,8 +223,8 @@ mod tests { assert!(n <= 6, "DAG size: {}", n); } - #[test] - fn imperfect_state_limits_test() { + #[tokio::test] + async fn imperfect_state_limits_test() { let gc_depth = 12; let rounds: Round = rand::thread_rng().gen_range(10..100); diff --git a/narwhal/node/Cargo.toml b/narwhal/node/Cargo.toml index 4c12fd20e11ae..fad18cfaba119 100644 --- a/narwhal/node/Cargo.toml +++ b/narwhal/node/Cargo.toml @@ -18,7 +18,7 @@ futures = "0.3.24" multiaddr = "0.14.0" mysten-network.workspace = true rand = "0.8.5" -store = { version = "0.1.0", package = "typed-store"} +store = { version = "0.4.0", package = "typed-store"} telemetry-subscribers.workspace = true thiserror = "1.0.35" tokio = { version = "1.20.1", features = ["full"] } diff --git a/narwhal/primary/src/block_synchronizer/tests/block_synchronizer_tests.rs b/narwhal/primary/src/block_synchronizer/tests/block_synchronizer_tests.rs index 4d1532101e43e..f665cc43df418 100644 --- a/narwhal/primary/src/block_synchronizer/tests/block_synchronizer_tests.rs +++ b/narwhal/primary/src/block_synchronizer/tests/block_synchronizer_tests.rs @@ -371,7 +371,7 @@ async fn test_successful_payload_synchronization() { // Assume that the request is the correct one and just immediately // store the batch to the payload store. for batch_id in m.digests { - payload_store.write((batch_id, worker), 1).await; + payload_store.async_write((batch_id, worker), 1).await; } } } @@ -816,7 +816,7 @@ async fn test_reply_with_payload_already_in_storage() { certificate_store.write(certificate.clone()).unwrap(); for entry in certificate.header.payload { - payload_store.write(entry, 1).await; + payload_store.async_write(entry, 1).await; } } } diff --git a/narwhal/primary/src/block_synchronizer/tests/handler_tests.rs b/narwhal/primary/src/block_synchronizer/tests/handler_tests.rs index 6769e26baf365..1da7792a52b85 100644 --- a/narwhal/primary/src/block_synchronizer/tests/handler_tests.rs +++ b/narwhal/primary/src/block_synchronizer/tests/handler_tests.rs @@ -277,7 +277,7 @@ async fn test_synchronize_block_payload() { .unwrap(); let cert_stored = fixture.certificate(&header); for e in cert_stored.clone().header.payload { - payload_store.write(e, 1).await; + payload_store.async_write(e, 1).await; } // AND a certificate with payload NOT available diff --git a/narwhal/primary/src/core.rs b/narwhal/primary/src/core.rs index ece5442d29bd6..3fdc1d4b18b3a 100644 --- a/narwhal/primary/src/core.rs +++ b/narwhal/primary/src/core.rs @@ -297,7 +297,9 @@ impl Core { } // Store the header. - self.header_store.write(header.id, header.clone()).await; + self.header_store + .async_write(header.id, header.clone()) + .await; self.metrics .headers_processed @@ -382,14 +384,14 @@ impl Core { // that are stored in the header store. This strategy can be used to re-deliver votes to // ensure progress / liveness. self.vote_digest_store - .write( + .sync_write( header.author.clone(), RoundVoteDigestPair { round: header.round, vote_digest, }, ) - .await; + .await?; Ok(()) } diff --git a/narwhal/primary/src/header_waiter.rs b/narwhal/primary/src/header_waiter.rs index 9e3f0f9a2e63a..9d9c43d755d52 100644 --- a/narwhal/primary/src/header_waiter.rs +++ b/narwhal/primary/src/header_waiter.rs @@ -142,7 +142,7 @@ impl HeaderWaiter { result.map_err(|e| DagError::NetworkError(format!("{e:?}")))?; for (worker_id, worker_digests) in digests { for digest in worker_digests { - store.write((digest, worker_id), 0u8).await; + store.async_write((digest, worker_id), 0u8).await; } } Ok(Some(deliver)) diff --git a/narwhal/primary/src/primary.rs b/narwhal/primary/src/primary.rs index 7bffaa4ab1159..a3ff4676ad637 100644 --- a/narwhal/primary/src/primary.rs +++ b/narwhal/primary/src/primary.rs @@ -722,7 +722,7 @@ impl WorkerToPrimary for WorkerReceiverHandler { ) -> Result, anemo::rpc::Status> { let message = request.into_body(); self.payload_store - .write((message.digest, message.worker_id), 0u8) + .async_write((message.digest, message.worker_id), 0u8) .await; Ok(anemo::Response::new(())) } diff --git a/narwhal/primary/src/tests/block_remover_tests.rs b/narwhal/primary/src/tests/block_remover_tests.rs index ad05c6a455a2e..b9d86a17f2bc8 100644 --- a/narwhal/primary/src/tests/block_remover_tests.rs +++ b/narwhal/primary/src/tests/block_remover_tests.rs @@ -76,13 +76,15 @@ async fn test_successful_blocks_delete() { dag.insert(certificate).await.unwrap(); // write the header - header_store.write(header.clone().id, header.clone()).await; + header_store + .async_write(header.clone().id, header.clone()) + .await; header_ids.push(header.clone().id); // write the batches to payload store payload_store - .write_all(vec![ + .sync_write_all(vec![ ((batch_1.clone().digest(), worker_id_0), 0), ((batch_2.clone().digest(), worker_id_1), 0), ]) @@ -236,13 +238,15 @@ async fn test_failed_blocks_delete() { dag.insert(certificate).await.unwrap(); // write the header - header_store.write(header.clone().id, header.clone()).await; + header_store + .async_write(header.clone().id, header.clone()) + .await; header_ids.push(header.clone().id); // write the batches to payload store payload_store - .write_all(vec![ + .sync_write_all(vec![ ((batch_1.clone().digest(), worker_id_0), 0), ((batch_2.clone().digest(), worker_id_1), 0), ]) diff --git a/narwhal/primary/src/tests/certificate_waiter_tests.rs b/narwhal/primary/src/tests/certificate_waiter_tests.rs index ca099c0a18370..544c14db117a6 100644 --- a/narwhal/primary/src/tests/certificate_waiter_tests.rs +++ b/narwhal/primary/src/tests/certificate_waiter_tests.rs @@ -284,7 +284,7 @@ async fn fetch_certificates_basic() { // Avoid any sort of missing payload by pre-populating the batch for (digest, worker_id) in headers.iter().flat_map(|h| h.payload.iter()) { - payload_store.write((*digest, *worker_id), 0u8).await; + payload_store.async_write((*digest, *worker_id), 0u8).await; } let total_certificates = fixture.authorities().count() * rounds as usize; diff --git a/narwhal/primary/src/tests/header_waiter_tests.rs b/narwhal/primary/src/tests/header_waiter_tests.rs index d39d47ffedc1a..32cee8884f7b5 100644 --- a/narwhal/primary/src/tests/header_waiter_tests.rs +++ b/narwhal/primary/src/tests/header_waiter_tests.rs @@ -104,7 +104,7 @@ async fn successfully_synchronize_batches() { // now simulate the write of the batch to the payload store payload_store - .write_all(missing_digests.into_iter().map(|e| ((e, worker_id), 1))) + .sync_write_all(missing_digests.into_iter().map(|e| ((e, worker_id), 1))) .await .unwrap(); diff --git a/narwhal/primary/src/tests/primary_tests.rs b/narwhal/primary/src/tests/primary_tests.rs index 484d1782c0f2f..8459b6c167990 100644 --- a/narwhal/primary/src/tests/primary_tests.rs +++ b/narwhal/primary/src/tests/primary_tests.rs @@ -400,7 +400,7 @@ async fn test_process_payload_availability_success() { certificate_store.write(certificate.clone()).unwrap(); for payload in certificate.header.payload { - payload_store.write(payload, 1).await; + payload_store.async_write(payload, 1).await; } } else { missing_certificates.insert(id); diff --git a/narwhal/primary/tests/integration_tests_validator_api.rs b/narwhal/primary/tests/integration_tests_validator_api.rs index f276f85aa36ab..d9e2dae6b135f 100644 --- a/narwhal/primary/tests/integration_tests_validator_api.rs +++ b/narwhal/primary/tests/integration_tests_validator_api.rs @@ -77,7 +77,7 @@ async fn test_get_collections() { // Write the header store .header_store - .write(header.clone().id, header.clone()) + .async_write(header.clone().id, header.clone()) .await; header_ids.push(header.clone().id); @@ -85,12 +85,15 @@ async fn test_get_collections() { // Write the batches to payload store store .payload_store - .write_all(vec![((batch.clone().digest(), worker_id), 0)]) + .sync_write_all(vec![((batch.clone().digest(), worker_id), 0)]) .await .expect("couldn't store batches"); if n != 4 { // Add batches to the workers store - store.batch_store.write(batch.digest(), batch.clone()).await; + store + .batch_store + .async_write(batch.digest(), batch.clone()) + .await; } else { missing_block = block_id; } @@ -274,7 +277,7 @@ async fn test_remove_collections() { // Write the header store .header_store - .write(header.clone().id, header.clone()) + .async_write(header.clone().id, header.clone()) .await; header_ids.push(header.clone().id); @@ -282,12 +285,15 @@ async fn test_remove_collections() { // Write the batches to payload store store .payload_store - .write_all(vec![((batch.clone().digest(), worker_id), 0)]) + .sync_write_all(vec![((batch.clone().digest(), worker_id), 0)]) .await .expect("couldn't store batches"); if n != 4 { // Add batches to the workers store - store.batch_store.write(batch.digest(), batch.clone()).await; + store + .batch_store + .async_write(batch.digest(), batch.clone()) + .await; } } @@ -1098,16 +1104,18 @@ async fn fixture_certificate( certificate_store.write(certificate.clone()).unwrap(); // Write the header - header_store.write(header.clone().id, header.clone()).await; + header_store + .async_write(header.clone().id, header.clone()) + .await; // Write the batches to payload store payload_store - .write_all(vec![((batch_digest, worker_id), 0)]) + .sync_write_all(vec![((batch_digest, worker_id), 0)]) .await .expect("couldn't store batches"); // Add a batch to the workers store - batch_store.write(batch_digest, batch.clone()).await; + batch_store.async_write(batch_digest, batch.clone()).await; (certificate, batch) } diff --git a/narwhal/test-utils/Cargo.toml b/narwhal/test-utils/Cargo.toml index 17e1647065862..6ddb3056beed1 100644 --- a/narwhal/test-utils/Cargo.toml +++ b/narwhal/test-utils/Cargo.toml @@ -38,7 +38,7 @@ types = { path = "../types", package = "narwhal-types" } worker = { path = "../worker", package = "narwhal-worker" } mysten-network.workspace = true -store = { version = "0.1.0", package = "typed-store"} +store = { version = "0.4.0", package = "typed-store"} workspace-hack.workspace = true telemetry-subscribers.workspace = true diff --git a/narwhal/types/Cargo.toml b/narwhal/types/Cargo.toml index 047acfb5f6752..aabb4323dfa05 100644 --- a/narwhal/types/Cargo.toml +++ b/narwhal/types/Cargo.toml @@ -26,7 +26,7 @@ roaring = "0.10.1" serde = { version = "1.0.144", features = ["derive"] } serde_with = "2.0.1" signature = "1.6.1" -store = { version = "0.1.0", package = "typed-store"} +store = { version = "0.4.0", package = "typed-store"} thiserror = "1.0.35" tokio = { version = "1.20.1", features = ["sync", "rt", "macros"] } tokio-util = { version = "0.7.4", features = ["codec"] } diff --git a/narwhal/worker/src/handlers.rs b/narwhal/worker/src/handlers.rs index 3a0b7576a452a..3cf3e95a9309d 100644 --- a/narwhal/worker/src/handlers.rs +++ b/narwhal/worker/src/handlers.rs @@ -45,7 +45,7 @@ impl WorkerToWorker for WorkerReceiverHandler { ) -> Result, anemo::rpc::Status> { let message = request.into_body(); let digest = message.batch.digest(); - self.store.write(digest, message.batch).await; + self.store.async_write(digest, message.batch).await; self.tx_others_batch .send(WorkerOthersBatchMessage { digest, @@ -242,7 +242,7 @@ impl PrimaryToWorker for PrimaryReceiverHandler { if let Some(batch) = response.into_body().batch { let digest = batch.digest(); if missing.remove(&digest) { - self.store.write(digest, batch).await; + self.store.async_write(digest, batch).await; } } if missing.is_empty() { diff --git a/narwhal/worker/src/quorum_waiter.rs b/narwhal/worker/src/quorum_waiter.rs index 94abb4e5af70b..a1055b65a03d8 100644 --- a/narwhal/worker/src/quorum_waiter.rs +++ b/narwhal/worker/src/quorum_waiter.rs @@ -119,7 +119,7 @@ impl QuorumWaiter { if total_stake >= threshold { let digest = batch.digest(); let metadata = batch.metadata.clone(); - self.store.write(digest, batch).await; + self.store.async_write(digest, batch).await; if self.tx_our_batch.send(WorkerOurBatchMessage{ digest, worker_id: self.id, diff --git a/narwhal/worker/src/tests/handlers_tests.rs b/narwhal/worker/src/tests/handlers_tests.rs index 64c5ba2630d03..3e4f3ae80adc0 100644 --- a/narwhal/worker/src/tests/handlers_tests.rs +++ b/narwhal/worker/src/tests/handlers_tests.rs @@ -104,7 +104,7 @@ async fn synchronize_when_batch_exists() { let batch = test_utils::batch(); let batch_id = batch.digest(); let missing = vec![batch_id]; - store.write(batch_id, batch).await; + store.async_write(batch_id, batch).await; // Set up mock behavior for child RequestBatches RPC. let target_primary = fixture.authorities().nth(1).unwrap(); @@ -137,7 +137,7 @@ async fn delete_batches() { let store = test_utils::open_batch_store(); let batch = test_utils::batch(); let digest = batch.digest(); - store.write(digest, batch.clone()).await; + store.async_write(digest, batch.clone()).await; // Send a delete request. let handler = PrimaryReceiverHandler { diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index d808e328fe491..55325dcafdfbf 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -58,7 +58,7 @@ if [ -n "$LOCAL_MSIM_PATH" ]; then else cargo_patch_args+=( --config 'patch.crates-io.tokio.git = "https://github.com/MystenLabs/mysten-sim.git"' - --config 'patch.crates-io.tokio.rev = "982cf1a544ebd1e2818330f9b1247a4c3dd26c13"' + --config 'patch.crates-io.tokio.rev = "b28d77f88434535b166cc60bd3e5018aa75cd705"' ) fi