diff --git a/Cargo.lock b/Cargo.lock index 2a884c2..aa0fdf6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.25" +version = "0.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f90148830dac590fac7ccfe78ec4a8ea404c60f75a24e16407a71f0f40de775" +checksum = "2e53b0a3d5760cd2ba9b787ae0c6440ad18ee294ff71b05e3381c900a7d16cfd" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -159,7 +159,7 @@ dependencies = [ "getrandom", "once_cell", "version_check", - "zerocopy 0.7.33", + "zerocopy", ] [[package]] @@ -270,9 +270,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" dependencies = [ "backtrace", ] @@ -331,9 +331,9 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +checksum = "9f2776ead772134d55b62dd45e59a79e21612d85d0af729b8b7d3967d601a62a" dependencies = [ "concurrent-queue", "event-listener 5.3.0", @@ -457,7 +457,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -492,7 +492,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -717,6 +717,9 @@ name = "bitflags" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] [[package]] name = "blake3" @@ -836,7 +839,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", "syn_derive", ] @@ -858,9 +861,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" dependencies = [ "bytemuck_derive", ] @@ -873,7 +876,7 @@ checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1022,7 +1025,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1330,7 +1333,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1354,7 +1357,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1365,7 +1368,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1487,6 +1490,15 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "doxygen-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "415b6ec780d34dcf624666747194393603d0373b7141eef01d12ee58881507d9" +dependencies = [ + "phf", +] + [[package]] name = "ecolor" version = "0.27.2" @@ -1670,7 +1682,7 @@ dependencies = [ "num-traits", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1691,7 +1703,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -1739,9 +1751,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1844,9 +1856,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "flate2" @@ -1882,7 +1894,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2012,7 +2024,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -2077,9 +2089,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if 1.0.0", "libc", @@ -2352,37 +2364,40 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "heed" -version = "0.12.4" -source = "git+https://github.com/meilisearch/heed?tag=v0.12.4#7a4542bc72dd60ef0f508c89900ea292218223fb" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a300b0deeb2957162d7752b0f063b3be1c88333af5bb4e7a57d8fb3716f50b" dependencies = [ + "bitflags 2.5.0", "byteorder", "heed-traits", "heed-types", "libc", - "lmdb-rkv-sys", + "lmdb-master-sys", "once_cell", "page_size", "serde", "synchronoise", "url", - "zerocopy 0.3.2", ] [[package]] name = "heed-traits" -version = "0.7.0" -source = "git+https://github.com/meilisearch/heed?tag=v0.12.4#7a4542bc72dd60ef0f508c89900ea292218223fb" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb3130048d404c57ce5a1ac61a903696e8fcde7e8c2991e9fcfc1f27c3ef74ff" [[package]] name = "heed-types" -version = "0.7.2" -source = "git+https://github.com/meilisearch/heed?tag=v0.12.4#7a4542bc72dd60ef0f508c89900ea292218223fb" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3cb0d6ba3700c9a57e83c013693e3eddb68a6d9b6781cacafc62a0d992e8ddb3" dependencies = [ "bincode", + "byteorder", "heed-traits", "serde", "serde_json", - "zerocopy 0.3.2", ] [[package]] @@ -2402,9 +2417,9 @@ dependencies = [ [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex-literal" @@ -3017,13 +3032,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] -name = "lmdb-rkv-sys" -version = "0.15.1" -source = "git+https://github.com/meilisearch/lmdb-rs#501aa34a1ab7f092e3ff54a6c22ff6c55931a2d8" +name = "lmdb-master-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc9048db3a58c0732d7236abc4909058f9d2708cfb6d7d047eb895fddec6419a" dependencies = [ "cc", + "doxygen-rs", "libc", - "pkg-config", ] [[package]] @@ -3285,9 +3301,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" dependencies = [ "num-bigint", "num-complex", @@ -3299,11 +3315,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", "serde", @@ -3311,9 +3326,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", "serde", @@ -3347,11 +3362,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -3395,7 +3409,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -3574,18 +3588,18 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owned_ttf_parser" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" +checksum = "6b41438d2fc63c46c74a2203bf5ccd82c41ba04347b2fcf5754f230b167067d5" dependencies = [ "ttf-parser", ] [[package]] name = "page_size" -version = "0.4.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" dependencies = [ "libc", "winapi 0.3.9", @@ -3622,9 +3636,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -3651,6 +3665,48 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.63", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" version = "1.1.5" @@ -3668,7 +3724,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -3685,9 +3741,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -3712,7 +3768,7 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plain_bitassets" -version = "0.8.2" +version = "0.8.3" dependencies = [ "addr", "anyhow", @@ -3760,7 +3816,7 @@ dependencies = [ [[package]] name = "plain_bitassets_app" -version = "0.8.2" +version = "0.8.3" dependencies = [ "anyhow", "async_zmq", @@ -3800,7 +3856,7 @@ dependencies = [ [[package]] name = "plain_bitassets_app_cli" -version = "0.8.2" +version = "0.8.3" dependencies = [ "anyhow", "bip300301", @@ -3814,7 +3870,7 @@ dependencies = [ [[package]] name = "plain_bitassets_app_rpc_api" -version = "0.8.2" +version = "0.8.3" dependencies = [ "bip300301", "fraction", @@ -3947,9 +4003,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -3962,9 +4018,9 @@ checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "psl" -version = "2.1.36" +version = "2.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167f4ebfd5ea32c7f268d6711b93a73e56ce5091f236d9c25c59d259acfd4b73" +checksum = "7b320cda4ad7e8f4269fa415754418f83b38c666a5e2e99ea48825b274a373f3" dependencies = [ "psl-types", ] @@ -4241,9 +4297,9 @@ checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -4332,15 +4388,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -4440,9 +4496,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "send_wrapper" @@ -4452,29 +4508,29 @@ checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" [[package]] name = "serde" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -4489,7 +4545,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -4528,7 +4584,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -4618,6 +4674,12 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -4680,9 +4742,9 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" dependencies = [ "serde", ] @@ -4797,7 +4859,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -4819,9 +4881,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "bf5be731623ca1a1fb7d8be6f261a3be6d3e2337b8a1f97be944d020c8fcb704" dependencies = [ "proc-macro2", "quote", @@ -4837,7 +4899,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -4849,18 +4911,6 @@ dependencies = [ "crossbeam-queue", ] -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - [[package]] name = "system-deps" version = "6.2.2" @@ -4920,27 +4970,27 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -5069,7 +5119,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -5212,7 +5262,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -5262,9 +5312,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "ttf-parser" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" +checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" [[package]] name = "type-map" @@ -5390,9 +5440,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -5440,7 +5490,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", "wasm-bindgen-shared", ] @@ -5474,7 +5524,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6284,43 +6334,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.3.2" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da091bab2bd35db397c46f5b81748b56f28f8fda837087fab9b6b07b6d66e3f1" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ - "byteorder", - "zerocopy-derive 0.2.0", -] - -[[package]] -name = "zerocopy" -version = "0.7.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "087eca3c1eaf8c47b94d02790dd086cd594b912d2043d4de4bfdd466b3befb7c" -dependencies = [ - "zerocopy-derive 0.7.33", -] - -[[package]] -name = "zerocopy-derive" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d498dbd1fd7beb83c86709ae1c33ca50942889473473d287d56ce4770a18edfb" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "synstructure", + "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.33" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4b6c273f496d8fd4eaf18853e6b448760225dc030ff2c485a786859aea6393" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] @@ -6340,7 +6369,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.63", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d4dd2a9..3c9ceb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ members = [ [workspace.package] authors = [ "Ash Manning " ] edition = "2021" -version = "0.8.2" +version = "0.8.3" [workspace.dependencies.bip300301] git = "https://github.com/Ash-L2L/bip300301.git" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index e44104d..8e6d97f 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -22,7 +22,7 @@ educe = { version = "0.4.23", features = ["Hash"] } fallible-iterator = "0.3.0" futures = "0.3.30" fraction = "0.14.0" -heed = { git = "https://github.com/meilisearch/heed", tag = "v0.12.4", version = "0.12.4" } +heed = "0.20.0" hex = { version = "0.4.3", features = ["serde"] } hex-literal = "0.4.1" itertools = "0.12.0" diff --git a/lib/archive.rs b/lib/archive.rs index 5fc7295..f595530 100644 --- a/lib/archive.rs +++ b/lib/archive.rs @@ -65,17 +65,20 @@ impl Archive { pub const NUM_DBS: u32 = 8; pub fn new(env: &heed::Env) -> Result { + let mut rwtxn = env.write_txn()?; let block_hash_to_height = - env.create_database(Some("hash_to_height"))?; + env.create_database(&mut rwtxn, Some("hash_to_height"))?; let bmm_verifications = - env.create_database(Some("bmm_verifications"))?; - let bodies = env.create_database(Some("bodies"))?; - let deposits = env.create_database(Some("deposits"))?; - let headers = env.create_database(Some("headers"))?; - let main_headers = env.create_database(Some("main_headers"))?; - let total_work = env.create_database(Some("total_work"))?; + env.create_database(&mut rwtxn, Some("bmm_verifications"))?; + let bodies = env.create_database(&mut rwtxn, Some("bodies"))?; + let deposits = env.create_database(&mut rwtxn, Some("deposits"))?; + let headers = env.create_database(&mut rwtxn, Some("headers"))?; + let main_headers = + env.create_database(&mut rwtxn, Some("main_headers"))?; + let total_work = env.create_database(&mut rwtxn, Some("total_work"))?; let txid_to_inclusions = - env.create_database(Some("txid_to_inclusions"))?; + env.create_database(&mut rwtxn, Some("txid_to_inclusions"))?; + rwtxn.commit()?; Ok(Self { block_hash_to_height, bmm_verifications, diff --git a/lib/mempool.rs b/lib/mempool.rs index 154e694..f20fe57 100644 --- a/lib/mempool.rs +++ b/lib/mempool.rs @@ -30,9 +30,14 @@ impl MemPool { pub const NUM_DBS: u32 = 3; pub fn new(env: &heed::Env) -> Result { - let transactions = env.create_database(Some("transactions"))?; - let spent_utxos = env.create_database(Some("spent_utxos"))?; - let address_to_txs = env.create_database(Some("address_to_txs"))?; + let mut rwtxn = env.write_txn()?; + let transactions = + env.create_database(&mut rwtxn, Some("transactions"))?; + let spent_utxos = + env.create_database(&mut rwtxn, Some("spent_utxos"))?; + let address_to_txs = + env.create_database(&mut rwtxn, Some("address_to_txs"))?; + rwtxn.commit()?; Ok(Self { transactions, spent_utxos, diff --git a/lib/net/mod.rs b/lib/net/mod.rs index 10580f1..af2aeb4 100644 --- a/lib/net/mod.rs +++ b/lib/net/mod.rs @@ -7,7 +7,7 @@ use std::{ use fallible_iterator::{FallibleIterator, IteratorExt}; use futures::{channel::mpsc, StreamExt}; use heed::{ - types::{OwnedType, SerdeBincode}, + types::{SerdeBincode, Unit}, Database, }; use parking_lot::RwLock; @@ -95,7 +95,7 @@ pub struct Net { // None indicates that the stream has ended peer_info_tx: mpsc::UnboundedSender<(SocketAddr, Option)>, - known_peers: Database, OwnedType<()>>, + known_peers: Database, Unit>, } impl Net { @@ -165,7 +165,10 @@ impl Net { let (server, _) = make_server_endpoint(bind_addr)?; let client = make_client_endpoint("0.0.0.0:0".parse()?)?; let active_peers = Arc::new(RwLock::new(HashMap::new())); - let known_peers = env.create_database(Some("known_peers"))?; + let mut rwtxn = env.write_txn()?; + let known_peers = + env.create_database(&mut rwtxn, Some("known_peers"))?; + rwtxn.commit()?; let (peer_info_tx, peer_info_rx) = mpsc::unbounded(); let net = Net { server, diff --git a/lib/node.rs b/lib/node.rs index ed69ca5..095edb5 100644 --- a/lib/node.rs +++ b/lib/node.rs @@ -245,7 +245,7 @@ async fn request_two_way_peg_data( } async fn connect_tip_( - rwtxn: &mut RwTxn<'_, '_>, + rwtxn: &mut RwTxn<'_>, archive: &Archive, drivechain: &bip300301::Drivechain, mempool: &MemPool, @@ -278,7 +278,7 @@ async fn connect_tip_( } async fn disconnect_tip_( - rwtxn: &mut RwTxn<'_, '_>, + rwtxn: &mut RwTxn<'_>, archive: &Archive, drivechain: &bip300301::Drivechain, mempool: &MemPool, @@ -818,15 +818,17 @@ impl Node { let env_path = datadir.join("data.mdb"); // let _ = std::fs::remove_dir_all(&env_path); std::fs::create_dir_all(&env_path)?; - let env = heed::EnvOpenOptions::new() - .map_size(10 * 1024 * 1024) // 10MB - .max_dbs( - State::NUM_DBS - + Archive::NUM_DBS - + MemPool::NUM_DBS - + Net::NUM_DBS, - ) - .open(env_path)?; + let env = unsafe { + heed::EnvOpenOptions::new() + .map_size(1024 * 1024 * 1024) // 1GB + .max_dbs( + State::NUM_DBS + + Archive::NUM_DBS + + MemPool::NUM_DBS + + Net::NUM_DBS, + ) + .open(env_path)? + }; let archive = Archive::new(&env)?; let drivechain = bip300301::Drivechain::new( THIS_SIDECHAIN, diff --git a/lib/state.rs b/lib/state.rs index de7861c..77e6b72 100644 --- a/lib/state.rs +++ b/lib/state.rs @@ -1052,24 +1052,28 @@ impl State { pub const WITHDRAWAL_BUNDLE_FAILURE_GAP: u32 = 5; pub fn new(env: &heed::Env) -> Result { - let tip = env.create_database(Some("tip"))?; - let height = env.create_database(Some("height"))?; - let amm_pools = env.create_database(Some("amm_pools"))?; + let mut rwtxn = env.write_txn()?; + let tip = env.create_database(&mut rwtxn, Some("tip"))?; + let height = env.create_database(&mut rwtxn, Some("height"))?; + let amm_pools = env.create_database(&mut rwtxn, Some("amm_pools"))?; let bitasset_reservations = - env.create_database(Some("bitasset_reservations"))?; + env.create_database(&mut rwtxn, Some("bitasset_reservations"))?; let bitasset_seq_to_bitasset = - env.create_database(Some("bitasset_seq_to_bitasset"))?; + env.create_database(&mut rwtxn, Some("bitasset_seq_to_bitasset"))?; let bitasset_to_bitasset_seq = - env.create_database(Some("bitasset_to_bitasset_seq"))?; - let bitassets = env.create_database(Some("bitassets"))?; - let dutch_auctions = env.create_database(Some("dutch_auctions"))?; - let utxos = env.create_database(Some("utxos"))?; - let stxos = env.create_database(Some("stxos"))?; + env.create_database(&mut rwtxn, Some("bitasset_to_bitasset_seq"))?; + let bitassets = env.create_database(&mut rwtxn, Some("bitassets"))?; + let dutch_auctions = + env.create_database(&mut rwtxn, Some("dutch_auctions"))?; + let utxos = env.create_database(&mut rwtxn, Some("utxos"))?; + let stxos = env.create_database(&mut rwtxn, Some("stxos"))?; let pending_withdrawal_bundle = - env.create_database(Some("pending_withdrawal_bundle"))?; + env.create_database(&mut rwtxn, Some("pending_withdrawal_bundle"))?; let withdrawal_bundles = - env.create_database(Some("withdrawal_bundles"))?; - let deposit_blocks = env.create_database(Some("deposit_blocks"))?; + env.create_database(&mut rwtxn, Some("withdrawal_bundles"))?; + let deposit_blocks = + env.create_database(&mut rwtxn, Some("deposit_blocks"))?; + rwtxn.commit()?; Ok(Self { tip, height, diff --git a/lib/types/hashes.rs b/lib/types/hashes.rs index 2f4e941..44d68c2 100644 --- a/lib/types/hashes.rs +++ b/lib/types/hashes.rs @@ -3,7 +3,6 @@ use std::str::FromStr; use bip300301::bitcoin; use bitcoin::hashes::Hash as _; use borsh::{BorshDeserialize, BorshSerialize}; -use heed::zerocopy::{self, AsBytes, FromBytes}; use hex::FromHex; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -132,7 +131,6 @@ impl std::fmt::Debug for MerkleRoot { } #[derive( - AsBytes, BorshDeserialize, BorshSerialize, Clone, @@ -140,7 +138,6 @@ impl std::fmt::Debug for MerkleRoot { Default, Deserialize, Eq, - FromBytes, Hash, Ord, PartialEq, diff --git a/lib/wallet.rs b/lib/wallet.rs index b2b49d6..880822a 100644 --- a/lib/wallet.rs +++ b/lib/wallet.rs @@ -8,7 +8,7 @@ use bip300301::bitcoin; use byteorder::{BigEndian, ByteOrder}; use ed25519_dalek_bip32::{ChildIndex, DerivationPath, ExtendedSigningKey}; use heed::{ - types::{OwnedType, SerdeBincode, Str}, + types::{Bytes, SerdeBincode, Str, U8}, Database, RoTxn, }; @@ -53,10 +53,14 @@ pub enum Error { #[derive(Clone)] pub struct Wallet { env: heed::Env, + // Seed is always [u8; 64], but due to serde not implementing serialize + // for [T; 64], use heed's `Bytes` // FIXME: Don't store the seed in plaintext. - seed: Database, OwnedType<[u8; 64]>>, - pub address_to_index: Database, OwnedType<[u8; 4]>>, - pub index_to_address: Database, SerdeBincode
>, + seed: Database, + pub address_to_index: + Database, SerdeBincode<[u8; 4]>>, + pub index_to_address: + Database, SerdeBincode
>, pub unconfirmed_utxos: Database, SerdeBincode>, pub utxos: Database, SerdeBincode>, @@ -66,7 +70,7 @@ pub struct Wallet { SerdeBincode>, >, /// Associates reservation commitments with plaintext BitAsset names - pub bitasset_reservations: Database, Str>, + pub bitasset_reservations: Database, Str>, /// Associates BitAssets with plaintext names pub known_bitassets: Database, Str>, } @@ -76,22 +80,29 @@ impl Wallet { pub fn new(path: &Path) -> Result { std::fs::create_dir_all(path)?; - let env = heed::EnvOpenOptions::new() - .map_size(10 * 1024 * 1024) // 10MB - .max_dbs(Self::NUM_DBS) - .open(path)?; - let seed_db = env.create_database(Some("seed"))?; - let address_to_index = env.create_database(Some("address_to_index"))?; - let index_to_address = env.create_database(Some("index_to_address"))?; + let env = unsafe { + heed::EnvOpenOptions::new() + .map_size(10 * 1024 * 1024) // 10MB + .max_dbs(Self::NUM_DBS) + .open(path)? + }; + let mut rwtxn = env.write_txn()?; + let seed_db = env.create_database(&mut rwtxn, Some("seed"))?; + let address_to_index = + env.create_database(&mut rwtxn, Some("address_to_index"))?; + let index_to_address = + env.create_database(&mut rwtxn, Some("index_to_address"))?; let unconfirmed_utxos = - env.create_database(Some("unconfirmed_utxos"))?; - let utxos = env.create_database(Some("utxos"))?; - let stxos = env.create_database(Some("stxos"))?; + env.create_database(&mut rwtxn, Some("unconfirmed_utxos"))?; + let utxos = env.create_database(&mut rwtxn, Some("utxos"))?; + let stxos = env.create_database(&mut rwtxn, Some("stxos"))?; let spent_unconfirmed_utxos = - env.create_database(Some("spent_unconfirmed_utxos"))?; + env.create_database(&mut rwtxn, Some("spent_unconfirmed_utxos"))?; let bitasset_reservations = - env.create_database(Some("bitasset_reservations"))?; - let known_bitassets = env.create_database(Some("known_bitassets"))?; + env.create_database(&mut rwtxn, Some("bitasset_reservations"))?; + let known_bitassets = + env.create_database(&mut rwtxn, Some("known_bitassets"))?; + rwtxn.commit()?; Ok(Self { env, seed: seed_db, @@ -112,7 +123,7 @@ impl Wallet { index: u32, ) -> Result { let seed = self.seed.get(txn, &0)?.ok_or(Error::NoSeed)?; - let xpriv = ExtendedSigningKey::from_seed(&seed)?; + let xpriv = ExtendedSigningKey::from_seed(seed)?; let derivation_path = DerivationPath::new([ ChildIndex::Hardened(1), ChildIndex::Hardened(0),