[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-depolymerization] branch master updated (83c8149 -> 9631a53)
From: |
gnunet |
Subject: |
[taler-depolymerization] branch master updated (83c8149 -> 9631a53) |
Date: |
Thu, 15 Sep 2022 21:27:20 +0200 |
This is an automated email from the git hooks/post-receive script.
antoine pushed a change to branch master
in repository depolymerization.
from 83c8149 Update geth (will need to test how well we support
Proof-of-Stake)
new 2304c7a Fix analysis and merge analysis loop into worker loop
new 9631a53 Fixed some dependency versions to correct Debian only
supporting an ageing version of rust
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
Cargo.lock | 279 ++++++++++++++++++++++-------------------
btc-wire/src/lib.rs | 6 +-
btc-wire/src/loops/analysis.rs | 76 ++++-------
btc-wire/src/loops/worker.rs | 18 +--
btc-wire/src/main.rs | 8 +-
common/Cargo.toml | 8 +-
eth-wire/src/lib.rs | 11 +-
eth-wire/src/loops/analysis.rs | 89 ++-----------
eth-wire/src/loops/worker.rs | 36 +++---
eth-wire/src/main.rs | 9 +-
instrumentation/src/btc.rs | 6 +-
instrumentation/src/eth.rs | 7 +-
wire-gateway/Cargo.toml | 4 +-
13 files changed, 242 insertions(+), 315 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 831ac2c..77ceb84 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -30,9 +30,9 @@ dependencies = [
[[package]]
name = "aho-corasick"
-version = "0.7.18"
+version = "0.7.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
+checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e"
dependencies = [
"memchr",
]
@@ -54,9 +54,9 @@ checksum =
"4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
[[package]]
name = "async-trait"
-version = "0.1.56"
+version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716"
+checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f"
dependencies = [
"proc-macro2",
"quote",
@@ -90,7 +90,7 @@ dependencies = [
"cc",
"cfg-if",
"libc",
- "miniz_oxide 0.5.3",
+ "miniz_oxide 0.5.4",
"object",
"rustc-demangle",
]
@@ -142,9 +142,9 @@ checksum =
"bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "block-buffer"
-version = "0.10.2"
+version = "0.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324"
+checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e"
dependencies = [
"generic-array",
]
@@ -181,9 +181,9 @@ dependencies = [
[[package]]
name = "bumpalo"
-version = "3.10.0"
+version = "3.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3"
+checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d"
[[package]]
name = "byteorder"
@@ -224,7 +224,6 @@ dependencies = [
"iana-time-zone",
"num-integer",
"num-traits",
- "serde",
"winapi",
]
@@ -302,9 +301,9 @@ dependencies = [
[[package]]
name = "clap_mangen"
-version = "0.1.10"
+version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "937efe4451c32be4ccb3e19549cbb1ea5cb85197f39b87a9662ca1d7b1765d1d"
+checksum = "105180c05a72388d5f5e4e4f6c79eecb92497bda749fa8f963a16647c5d5377f"
dependencies = [
"clap",
"roff",
@@ -349,9 +348,9 @@ checksum =
"5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
[[package]]
name = "cpufeatures"
-version = "0.2.2"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b"
+checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
dependencies = [
"libc",
]
@@ -486,9 +485,9 @@ dependencies = [
[[package]]
name = "darling"
-version = "0.14.1"
+version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4529658bdda7fd6769b8614be250cdcfc3aeb0ee72fe66f9e41e5e5eb73eac02"
+checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c"
dependencies = [
"darling_core",
"darling_macro",
@@ -496,9 +495,9 @@ dependencies = [
[[package]]
name = "darling_core"
-version = "0.14.1"
+version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "649c91bc01e8b1eac09fb91e8dbc7d517684ca6be8ebc75bb9cafc894f9fdb6f"
+checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610"
dependencies = [
"fnv",
"ident_case",
@@ -510,9 +509,9 @@ dependencies = [
[[package]]
name = "darling_macro"
-version = "0.14.1"
+version = "0.13.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ddfc69c5bfcbd2fc09a0f38451d2daf0e372e367986a83906d1b0dbc88134fb5"
+checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835"
dependencies = [
"darling_core",
"quote",
@@ -572,9 +571,9 @@ checksum =
"0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257"
[[package]]
name = "either"
-version = "1.7.0"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be"
+checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797"
[[package]]
name = "env_logger"
@@ -658,14 +657,14 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
dependencies = [
"crc32fast",
- "miniz_oxide 0.5.3",
+ "miniz_oxide 0.5.4",
]
[[package]]
name = "flexi_logger"
-version = "0.23.3"
+version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f4a12e3b5a8775259ee83ac38aea8cdf9c3a1667c02178d207378c0837808fa9"
+checksum = "f8790f70905b203171c21060222f18f1df5cba07317860215b7880b32aaef290"
dependencies = [
"chrono",
"glob",
@@ -691,11 +690,26 @@ dependencies = [
"percent-encoding",
]
+[[package]]
+name = "futures"
+version = "0.3.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c"
+dependencies = [
+ "futures-channel",
+ "futures-core",
+ "futures-executor",
+ "futures-io",
+ "futures-sink",
+ "futures-task",
+ "futures-util",
+]
+
[[package]]
name = "futures-channel"
-version = "0.3.21"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010"
+checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050"
dependencies = [
"futures-core",
"futures-sink",
@@ -703,15 +717,32 @@ dependencies = [
[[package]]
name = "futures-core"
-version = "0.3.21"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3"
+checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf"
+
+[[package]]
+name = "futures-executor"
+version = "0.3.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab"
+dependencies = [
+ "futures-core",
+ "futures-task",
+ "futures-util",
+]
+
+[[package]]
+name = "futures-io"
+version = "0.3.24"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68"
[[package]]
name = "futures-macro"
-version = "0.3.21"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512"
+checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17"
dependencies = [
"proc-macro2",
"quote",
@@ -720,26 +751,29 @@ dependencies = [
[[package]]
name = "futures-sink"
-version = "0.3.21"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868"
+checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56"
[[package]]
name = "futures-task"
-version = "0.3.21"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a"
+checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1"
[[package]]
name = "futures-util"
-version = "0.3.21"
+version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a"
+checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90"
dependencies = [
+ "futures-channel",
"futures-core",
+ "futures-io",
"futures-macro",
"futures-sink",
"futures-task",
+ "memchr",
"pin-project-lite",
"pin-utils",
"slab",
@@ -747,9 +781,9 @@ dependencies = [
[[package]]
name = "generic-array"
-version = "0.14.5"
+version = "0.14.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803"
+checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9"
dependencies = [
"typenum",
"version_check",
@@ -831,7 +865,7 @@ checksum =
"75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [
"bytes",
"fnv",
- "itoa 1.0.2",
+ "itoa 1.0.3",
]
[[package]]
@@ -847,9 +881,9 @@ dependencies = [
[[package]]
name = "httparse"
-version = "1.7.1"
+version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c"
+checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"
[[package]]
name = "httpdate"
@@ -871,7 +905,7 @@ dependencies = [
"http-body",
"httparse",
"httpdate",
- "itoa 1.0.2",
+ "itoa 1.0.3",
"pin-project-lite",
"socket2",
"tokio",
@@ -940,7 +974,6 @@ checksum =
"10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e"
dependencies = [
"autocfg",
"hashbrown",
- "serde",
]
[[package]]
@@ -974,9 +1007,9 @@ dependencies = [
[[package]]
name = "itertools"
-version = "0.10.3"
+version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
+checksum = "d8bf247779e67a9082a4790b45e71ac7cfd1321331a5c856a74a9faebdab78d0"
dependencies = [
"either",
]
@@ -989,15 +1022,15 @@ checksum =
"b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "itoa"
-version = "1.0.2"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d"
+checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754"
[[package]]
name = "js-sys"
-version = "0.3.59"
+version = "0.3.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2"
+checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
dependencies = [
"wasm-bindgen",
]
@@ -1010,9 +1043,9 @@ checksum =
"e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.126"
+version = "0.2.132"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836"
+checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5"
[[package]]
name = "libdeflate-sys"
@@ -1045,9 +1078,9 @@ dependencies = [
[[package]]
name = "lock_api"
-version = "0.4.7"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53"
+checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390"
dependencies = [
"autocfg",
"scopeguard",
@@ -1064,9 +1097,9 @@ dependencies = [
[[package]]
name = "md-5"
-version = "0.10.1"
+version = "0.10.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "658646b21e0b72f7866c7038ab086d3d5e1cd6271f060fd37defb241949d0582"
+checksum = "66b48670c893079d3c2ed79114e3644b7004df1c361a4e0ad52e2e6940d07c3d"
dependencies = [
"digest",
]
@@ -1088,9 +1121,9 @@ dependencies = [
[[package]]
name = "miniz_oxide"
-version = "0.5.3"
+version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc"
+checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
dependencies = [
"adler",
]
@@ -1187,9 +1220,9 @@ dependencies = [
[[package]]
name = "os_str_bytes"
-version = "6.2.0"
+version = "6.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4"
+checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff"
[[package]]
name = "owo-colors"
@@ -1228,36 +1261,36 @@ checksum =
"478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
[[package]]
name = "phf"
-version = "0.11.1"
+version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "928c6535de93548188ef63bb7c4036bd415cd8f36ad25af44b9789b2ee72a48c"
+checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259"
dependencies = [
"phf_shared",
]
[[package]]
name = "phf_shared"
-version = "0.11.1"
+version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1fb5f6f826b772a8d4c0394209441e7d37cbbb967ae9c7e0e8134365c9ee676"
+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
dependencies = [
"siphasher",
]
[[package]]
name = "pin-project"
-version = "1.0.11"
+version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "78203e83c48cffbe01e4a2d35d566ca4de445d79a85372fc64e378bfc812a260"
+checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc"
dependencies = [
"pin-project-internal",
]
[[package]]
name = "pin-project-internal"
-version = "1.0.11"
+version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "710faf75e1b33345361201d36d04e98ac1ed8909151a017ed384700836104c74"
+checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55"
dependencies = [
"proc-macro2",
"quote",
@@ -1278,9 +1311,9 @@ checksum =
"8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "plotters"
-version = "0.3.2"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9428003b84df1496fb9d6eeee9c5f8145cb41ca375eb0dad204328888832811f"
+checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97"
dependencies = [
"num-traits",
"plotters-backend",
@@ -1297,22 +1330,22 @@ checksum =
"193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142"
[[package]]
name = "plotters-svg"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0918736323d1baff32ee0eade54984f6f201ad7e97d5cfb5d6ab4a358529615"
+checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f"
dependencies = [
"plotters-backend",
]
[[package]]
name = "postgres"
-version = "0.19.4"
+version = "0.19.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "960c214283ef8f0027974c03e9014517ced5db12f021a9abb66185a5751fab0a"
+checksum = "c8bbcd5f6deb39585a0d9f4ef34c4a41c25b7ad26d23c75d837d78c8e7adc85f"
dependencies = [
"bytes",
"fallible-iterator",
- "futures-util",
+ "futures",
"log",
"tokio",
"tokio-postgres",
@@ -1390,9 +1423,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
-version = "1.0.42"
+version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c278e965f1d8cf32d6e0e96de3d3e79712178ae67986d9cf9151f51e95aac89b"
+checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab"
dependencies = [
"unicode-ident",
]
@@ -1421,9 +1454,9 @@ dependencies = [
[[package]]
name = "quote"
-version = "1.0.20"
+version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804"
+checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
"proc-macro2",
]
@@ -1451,9 +1484,9 @@ dependencies = [
[[package]]
name = "rand_core"
-version = "0.6.3"
+version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
dependencies = [
"getrandom",
]
@@ -1586,15 +1619,15 @@ dependencies = [
[[package]]
name = "rustversion"
-version = "1.0.8"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8"
+checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8"
[[package]]
name = "ryu"
-version = "1.0.10"
+version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695"
+checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
[[package]]
name = "same-file"
@@ -1667,7 +1700,7 @@ version = "1.0.85"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44"
dependencies = [
- "itoa 1.0.2",
+ "itoa 1.0.3",
"ryu",
"serde",
]
@@ -1690,32 +1723,26 @@ source =
"registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
"form_urlencoded",
- "itoa 1.0.2",
+ "itoa 1.0.3",
"ryu",
"serde",
]
[[package]]
name = "serde_with"
-version = "2.0.1"
+version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "368f2d60d049ea019a84dcd6687b0d1e0030fe663ae105039bdf967ed5e6a9a7"
+checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff"
dependencies = [
- "base64",
- "chrono",
- "hex",
- "indexmap",
"serde",
- "serde_json",
"serde_with_macros",
- "time",
]
[[package]]
name = "serde_with_macros"
-version = "2.0.1"
+version = "1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ccadfacf6cf10faad22bbadf55986bdd0856edfb5d9210aa1dcf1f516e84e93"
+checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082"
dependencies = [
"darling",
"proc-macro2",
@@ -1725,9 +1752,9 @@ dependencies = [
[[package]]
name = "sha2"
-version = "0.10.2"
+version = "0.10.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676"
+checksum = "cf9db03534dff993187064c4e0c05a5708d2a9728ace9a8959b77bedf415dac5"
dependencies = [
"cfg-if",
"cpufeatures",
@@ -1757,9 +1784,9 @@ checksum =
"2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1"
[[package]]
name = "socket2"
-version = "0.4.4"
+version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0"
+checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
dependencies = [
"libc",
"winapi",
@@ -1801,9 +1828,9 @@ checksum =
"6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
[[package]]
name = "syn"
-version = "1.0.98"
+version = "1.0.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
+checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13"
dependencies = [
"proc-macro2",
"quote",
@@ -1861,14 +1888,13 @@ dependencies = [
[[package]]
name = "time"
-version = "0.3.14"
+version = "0.3.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b"
+checksum = "db76ff9fa4b1458b3c7f077f3ff9887394058460d21e634355b273aaf11eea45"
dependencies = [
- "itoa 1.0.2",
+ "itoa 1.0.3",
"libc",
"num_threads",
- "serde",
"time-macros",
]
@@ -1944,16 +1970,15 @@ dependencies = [
[[package]]
name = "tokio-postgres"
-version = "0.7.7"
+version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "29a12c1b3e0704ae7dfc25562629798b29c72e6b1d0a681b6f29ab4ae5e7f7bf"
+checksum = "19c88a47a23c5d2dc9ecd28fb38fba5fc7e5ddc1fe64488ec145076b0c71c8ae"
dependencies = [
"async-trait",
"byteorder",
"bytes",
"fallible-iterator",
- "futures-channel",
- "futures-util",
+ "futures",
"log",
"parking_lot",
"percent-encoding",
@@ -1968,9 +1993,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.7.3"
+version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45"
+checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
dependencies = [
"bytes",
"futures-core",
@@ -2038,9 +2063,9 @@ checksum =
"099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"
[[package]]
name = "unicode-ident"
-version = "1.0.2"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7"
+checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd"
[[package]]
name = "unicode-normalization"
@@ -2143,9 +2168,9 @@ checksum =
"9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.82"
+version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d"
+checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@@ -2153,9 +2178,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.82"
+version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f"
+checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
dependencies = [
"bumpalo",
"log",
@@ -2168,9 +2193,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.82"
+version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602"
+checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -2178,9 +2203,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.82"
+version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da"
+checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [
"proc-macro2",
"quote",
@@ -2191,15 +2216,15 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.82"
+version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a"
+checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
[[package]]
name = "web-sys"
-version = "0.3.59"
+version = "0.3.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1"
+checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
dependencies = [
"js-sys",
"wasm-bindgen",
diff --git a/btc-wire/src/lib.rs b/btc-wire/src/lib.rs
index 04e3314..014362e 100644
--- a/btc-wire/src/lib.rs
+++ b/btc-wire/src/lib.rs
@@ -14,7 +14,7 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
use std::path::{Path, PathBuf};
-use std::{str::FromStr, sync::atomic::AtomicU32};
+use std::str::FromStr;
use bitcoin::{hashes::hex::FromHex, Address, Amount, Network, Txid};
use btc_config::BitcoinConfig;
@@ -148,7 +148,7 @@ const DEFAULT_CONFIRMATION: u16 = 6;
const DEFAULT_BOUNCE_FEE: &str = "0.00001";
pub struct WireState {
- pub confirmation: AtomicU32,
+ pub confirmation: u32,
pub max_confirmation: u32,
pub btc_config: BitcoinConfig,
pub bounce_fee: Amount,
@@ -166,7 +166,7 @@ impl WireState {
BitcoinConfig::load(path, currency).or_fail(|e| format!("bitcoin
config: {}", e));
let init_confirmation =
taler_config.confirmation().unwrap_or(DEFAULT_CONFIRMATION) as u32;
Self {
- confirmation: AtomicU32::new(init_confirmation),
+ confirmation: init_confirmation,
max_confirmation: init_confirmation * 2,
bounce_fee: config_bounce_fee(&taler_config.bounce_fee(),
currency),
lifetime: taler_config.wire_lifetime(),
diff --git a/btc-wire/src/loops/analysis.rs b/btc-wire/src/loops/analysis.rs
index f3125fe..41bee1b 100644
--- a/btc-wire/src/loops/analysis.rs
+++ b/btc-wire/src/loops/analysis.rs
@@ -13,61 +13,31 @@
You should have received a copy of the GNU Affero General Public License
along with
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-use std::{sync::atomic::Ordering, time::Duration};
-
-use btc_wire::rpc::{AutoRpcCommon, ChainTipsStatus};
-use common::{
- log::log::{error, warn},
- postgres::fallible_iterator::FallibleIterator,
- reconnect::AutoReconnectDb,
-};
+use btc_wire::rpc::{ChainTipsStatus, Rpc};
+use common::log::log::warn;
use super::LoopResult;
-use crate::WireState;
-
-/// Analyse blockchain behavior and adapt confirmations in real time
-pub fn analysis(mut rpc: AutoRpcCommon, mut db: AutoReconnectDb, state:
&WireState) {
- // The biggest fork ever seen
- let mut max_seen = 0;
- loop {
- let rpc = rpc.client();
- let db = db.client();
- let result: LoopResult<()> = (|| {
- // Register as listener
- db.batch_execute("LISTEN new_block")?;
- loop {
- // Get biggest known valid fork
- let fork = rpc
- .get_chain_tips()?
- .into_iter()
- .filter_map(|t| (t.status ==
ChainTipsStatus::ValidFork).then(|| t.length))
- .max()
- .unwrap_or(0) as u32;
- // The first time we see a fork that big
- if fork > max_seen {
- max_seen = fork;
- let current_conf =
state.confirmation.load(Ordering::SeqCst);
- // If new fork is bigger than the current confirmation
- if fork > current_conf {
- // Max two time the configuration
- let new_conf = fork.min(state.max_confirmation);
- state.confirmation.store(new_conf, Ordering::SeqCst);
- warn!(
- "analysis: found dangerous fork of {} blocks,
adapt confirmation to {} blocks capped at {}, you should update taler.conf",
- fork, new_conf, state.max_confirmation
- );
- }
- }
- // TODO smarter analysis: suspicious transaction value, limit
wire bitcoin throughput
-
- // Wait for next notification
- db.notifications().blocking_iter().next()?;
- }
- })();
- if let Err(e) = result {
- error!("analysis: {}", e);
- std::thread::sleep(Duration::from_secs(5));
- }
+/// Analyse blockchain behavior and return the new confirmation delay
+pub fn analysis(rpc: &mut Rpc, current: u32, max: u32) -> LoopResult<u32> {
+ // Get biggest known valid fork
+ let fork = rpc
+ .get_chain_tips()?
+ .into_iter()
+ .filter_map(|t| (t.status == ChainTipsStatus::ValidFork).then(||
t.length))
+ .max()
+ .unwrap_or(0) as u32;
+ // If new fork is bigger than what current confirmation delay protect
against
+ if fork >= current {
+ // Limit confirmation growth
+ let new_conf = fork.saturating_add(1).min(max);
+ warn!(
+ "analysis: found dangerous fork of {} blocks, adapt confirmation
to {} blocks capped at {}, you should update taler.conf",
+ fork, new_conf, max
+ );
+ return Ok(new_conf);
}
+
+ // TODO smarter analysis: suspicious transaction value, limit wire bitcoin
throughput
+ return Ok(current);
}
diff --git a/btc-wire/src/loops/worker.rs b/btc-wire/src/loops/worker.rs
index fdff815..cce84fd 100644
--- a/btc-wire/src/loops/worker.rs
+++ b/btc-wire/src/loops/worker.rs
@@ -16,7 +16,6 @@
use std::{
collections::HashMap,
fmt::Write,
- sync::atomic::Ordering,
time::{Duration, SystemTime},
};
@@ -47,10 +46,10 @@ use crate::{
WireState,
};
-use super::{LoopError, LoopResult};
+use super::{analysis::analysis, LoopError, LoopResult};
/// Synchronize local db with blockchain and perform transactions
-pub fn worker(mut rpc: AutoRpcWallet, mut db: AutoReconnectDb, state:
&WireState) {
+pub fn worker(mut rpc: AutoRpcWallet, mut db: AutoReconnectDb, mut state:
WireState) {
let mut lifetime = state.lifetime;
let mut status = true;
let mut skip_notification = false;
@@ -100,12 +99,15 @@ pub fn worker(mut rpc: AutoRpcWallet, mut db:
AutoReconnectDb, state: &WireState
return Err(LoopError::Concurrency);
}
+ // Perform analysis
+ state.confirmation = analysis(rpc, state.confirmation,
state.max_confirmation)?;
+
// Sync chain
- if let Some(stuck) = sync_chain(rpc, db, state, &mut status)? {
+ if let Some(stuck) = sync_chain(rpc, db, &state, &mut status)? {
// As we are now in sync with the blockchain if a transaction
has Requested status it have not been sent
// Send requested debits
- while debit(db, rpc, state)? {}
+ while debit(db, rpc, &state)? {}
// Bump stuck transactions
for id in stuck {
@@ -161,8 +163,8 @@ fn sync_chain(
) -> LoopResult<Option<Vec<Txid>>> {
// Get stored last_hash
let last_hash = last_hash(db)?;
- // Use the same confirmation delay for this sync
- let conf_delay = state.confirmation.load(Ordering::SeqCst);
+ // Get the current confirmation delay
+ let conf_delay = state.confirmation;
// Get a set of transactions ids to parse
let (txs, removed, lastblock): (
@@ -171,7 +173,7 @@ fn sync_chain(
BlockHash,
) = {
// Get all transactions made since this block
- let list = rpc.list_since_block(Some(&last_hash), conf_delay)?;
+ let list = rpc.list_since_block(Some(&last_hash), conf_delay as u32)?;
// Only keep ids and category
let txs = list
.transactions
diff --git a/btc-wire/src/main.rs b/btc-wire/src/main.rs
index c0afd0c..562ca55 100644
--- a/btc-wire/src/main.rs
+++ b/btc-wire/src/main.rs
@@ -30,7 +30,7 @@ use common::{
use loops::LoopResult;
use std::path::PathBuf;
-use crate::loops::{analysis::analysis, watcher::watcher, worker::worker};
+use crate::loops::{watcher::watcher, worker::worker};
mod fail_point;
mod loops;
@@ -140,7 +140,6 @@ fn init(config: Option<PathBuf>, init: Init) ->
LoopResult<()> {
fn run(config: Option<PathBuf>) {
let state = WireState::load_taler_config(config.as_deref());
- let state: &'static _ = Box::leak(Box::new(state));
#[cfg(feature = "fail")]
if state.btc_config.network == Network::Regtest {
@@ -159,16 +158,11 @@ fn run(config: Option<PathBuf>) {
// TODO Check wire wallet own config PAYTO address
let rpc_watcher = auto_rpc_common(state.btc_config.clone());
- let rpc_analysis = auto_rpc_common(state.btc_config.clone());
let rpc_worker = auto_rpc_wallet(state.btc_config.clone(),
WIRE_WALLET_NAME);
let db_watcher = auto_reconnect_db(state.db_config.clone());
- let db_analysis = auto_reconnect_db(state.db_config.clone());
let db_worker = auto_reconnect_db(state.db_config.clone());
named_spawn("watcher", move || watcher(rpc_watcher, db_watcher));
- named_spawn("analysis", move || {
- analysis(rpc_analysis, db_analysis, state)
- });
worker(rpc_worker, db_worker, state);
info!("btc-wire stopped");
}
diff --git a/common/Cargo.toml b/common/Cargo.toml
index 090e359..b64bf08 100644
--- a/common/Cargo.toml
+++ b/common/Cargo.toml
@@ -11,7 +11,7 @@ rust-version = "1.57.0"
# Serialization framework
serde = { version = "1.0.144", features = ["derive"] }
# Serialization helper
-serde_with = "2.0.1"
+serde_with = "1.14.0"
# JSON serialization
serde_json = "1.0.85"
# Url format
@@ -24,13 +24,13 @@ thiserror = "1.0.35"
rust-ini = "0.18.0"
# Logging
log = "0.4.17"
-flexi_logger = { version = "0.23.3", default-features = false, features = [
+flexi_logger = { version = "=0.23.0", default-features = false, features = [
"use_chrono_for_offset", # Temporary hack for multithreaded code
https://rustsec.org/advisories/RUSTSEC-2020-0159
] }
# Localized time
-time = { version = "0.3.14", features = ["formatting", "macros"] }
+time = { version = "=0.3.13", features = ["formatting", "macros"] }
# Postgres client
-postgres = "0.19.4"
+postgres = "=0.19.3"
# Secure random
rand = { version = "0.8.5", features = ["getrandom"] }
# Securely zero memory
diff --git a/eth-wire/src/lib.rs b/eth-wire/src/lib.rs
index 041f3ba..71ab818 100644
--- a/eth-wire/src/lib.rs
+++ b/eth-wire/src/lib.rs
@@ -18,7 +18,6 @@ use std::{
fmt::Debug,
path::{Path, PathBuf},
str::FromStr,
- sync::atomic::AtomicU32,
};
use common::{
@@ -109,7 +108,7 @@ pub trait RpcExtended: RpcClient {
})
}
- /// List new and removed transaction since the last sync state, returning
a new sync state
+ /// List new and removed transaction since the last sync state and the
size of the reorganized fork if any, returning a new sync state
fn list_since_sync(
&mut self,
address: &Address,
@@ -127,6 +126,7 @@ pub trait RpcExtended: RpcClient {
let mut txs = Vec::new();
let mut removed = Vec::new();
+ let mut fork_len = 0;
// Add pending transaction
txs.extend(match_tx(self.pending_transactions()?, 0));
@@ -153,6 +153,7 @@ pub trait RpcExtended: RpcClient {
chain_cursor = self.block(&chain_cursor.parent_hash)?.unwrap();
fork_cursor = self.block(&fork_cursor.parent_hash)?.unwrap();
confirmation += 1;
+ fork_len += 1;
}
}
@@ -166,6 +167,7 @@ pub trait RpcExtended: RpcClient {
Ok(ListSinceSync {
txs,
removed,
+ fork_len,
state: SyncState {
tip_hash: latest.hash.unwrap(),
tip_height: latest.number.unwrap(),
@@ -190,6 +192,7 @@ pub struct ListSinceSync {
pub txs: Vec<SyncTransaction>,
pub removed: Vec<SyncTransaction>,
pub state: SyncState,
+ pub fork_len: u32,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@@ -221,7 +224,7 @@ const DEFAULT_CONFIRMATION: u16 = 37;
const DEFAULT_BOUNCE_FEE: &str = "0.00001";
pub struct WireState {
- pub confirmation: AtomicU32,
+ pub confirmation: u32,
pub max_confirmations: u32,
pub address: H160,
pub bounce_fee: U256,
@@ -240,7 +243,7 @@ impl WireState {
let init_confirmation =
taler_config.confirmation().unwrap_or(DEFAULT_CONFIRMATION) as u32;
let payto = taler_config.payto();
Self {
- confirmation: AtomicU32::new(init_confirmation),
+ confirmation: init_confirmation,
max_confirmations: init_confirmation * 2,
address: eth_payto_addr(&payto).unwrap(),
ipc_path,
diff --git a/eth-wire/src/loops/analysis.rs b/eth-wire/src/loops/analysis.rs
index 471409c..546eb1e 100644
--- a/eth-wire/src/loops/analysis.rs
+++ b/eth-wire/src/loops/analysis.rs
@@ -14,86 +14,21 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-use std::sync::atomic::Ordering;
-
-use common::{
- log::log::{error, warn},
- postgres::fallible_iterator::FallibleIterator,
- reconnect::AutoReconnectDb,
-};
-use eth_wire::rpc::{AutoRpcCommon, Rpc, RpcClient};
-use ethereum_types::{H256, U64};
-
-use crate::WireState;
+use common::log::log::warn;
use super::LoopResult;
/// Analyse blockchain behavior and adapt confirmations in real time
-pub fn analysis(mut rpc: AutoRpcCommon, mut db: AutoReconnectDb, state:
&WireState) {
- // The biggest fork ever seen
- let mut max_seen = 0;
- let mut tip: Option<(U64, H256)> = None;
- loop {
- let rpc = rpc.client();
- let db = db.client();
- let result: LoopResult<()> = (|| {
- // Register as listener
- db.batch_execute("LISTEN new_block")?;
- loop {
- // Get biggest known valid fork
- let (fork, new_tip) = check_fork(rpc, &tip)?;
- tip.replace(new_tip);
- // The first time we see a fork that big
- if fork > max_seen {
- max_seen = fork;
- let current_conf =
state.confirmation.load(Ordering::SeqCst);
- // If new fork is bigger than the current confirmation
- if fork > current_conf {
- // Max two time the configuration
- let new_conf = fork.min(state.max_confirmations);
- state.confirmation.store(new_conf, Ordering::SeqCst);
- warn!(
- "analysis: found dangerous fork of {} blocks,
adapt confirmation to {} blocks capped at {}, you should update taler.conf",
- fork, new_conf, state.max_confirmations
- );
- }
- }
-
- // TODO smarter analysis: suspicious transaction value, limit
wire bitcoin throughput
-
- // Wait for next notification
- db.notifications().blocking_iter().next()?;
- }
- })();
- if let Err(e) = result {
- error!("analysis: {}", e);
- }
- }
-}
-
-/// Return fork size and new tip
-pub fn check_fork(rpc: &mut Rpc, tip: &Option<(U64, H256)>) ->
LoopResult<(u32, (U64, H256))> {
- let mut size = 0;
- let latest = rpc.latest_block()?;
- if let Some((number, hash)) = tip {
- let mut chain_cursor = latest.clone();
- // Skip until tip height
- while chain_cursor.number.unwrap() != *number {
- chain_cursor = rpc.block(&chain_cursor.parent_hash)?.unwrap();
- size += 1;
- }
-
- // Check fork
- if chain_cursor.hash.unwrap() != *hash {
- let mut fork_cursor = rpc.block(hash)?.unwrap();
- while fork_cursor.hash != chain_cursor.hash {
- chain_cursor = rpc.block(&chain_cursor.parent_hash)?.unwrap();
- fork_cursor = rpc.block(&fork_cursor.parent_hash)?.unwrap();
- size += 1;
- }
- } else {
- size = 0;
- }
+pub fn analysis(fork: u32, current: u32, max: u32) -> LoopResult<u32> {
+ // If new fork is bigger than what current confirmation delay protect
against
+ if fork >= current {
+ // Limit confirmation growth
+ let new_conf = fork.saturating_add(1).min(max);
+ warn!(
+ "analysis: found dangerous fork of {} blocks, adapt confirmation
to {} blocks capped at {}, you should update taler.conf",
+ fork, new_conf, max
+ );
+ return Ok(new_conf);
}
- Ok((size, (latest.number.unwrap(), latest.hash.unwrap())))
+ return Ok(current);
}
diff --git a/eth-wire/src/loops/worker.rs b/eth-wire/src/loops/worker.rs
index da68160..379ea6f 100644
--- a/eth-wire/src/loops/worker.rs
+++ b/eth-wire/src/loops/worker.rs
@@ -13,7 +13,7 @@
You should have received a copy of the GNU Affero General Public License
along with
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-use std::{fmt::Write, sync::atomic::Ordering, time::SystemTime};
+use std::{fmt::Write, time::SystemTime};
use common::{
api_common::base32,
@@ -27,7 +27,7 @@ use common::{
use eth_wire::{
rpc::{self, AutoRpcWallet, Rpc, RpcClient, Transaction,
TransactionRequest},
taler_util::{eth_payto_url, eth_to_taler},
- RpcExtended, SyncState, SyncTransaction,
+ ListSinceSync, RpcExtended, SyncState, SyncTransaction,
};
use ethereum_types::{Address, H256, U256};
@@ -38,9 +38,9 @@ use crate::{
WireState,
};
-use super::LoopResult;
+use super::{analysis::analysis, LoopResult};
-pub fn worker(mut rpc: AutoRpcWallet, mut db: AutoReconnectDb, state:
&WireState) {
+pub fn worker(mut rpc: AutoRpcWallet, mut db: AutoReconnectDb, mut state:
WireState) {
let mut lifetime = state.lifetime;
let mut status = true;
let mut skip_notification = false;
@@ -90,15 +90,26 @@ pub fn worker(mut rpc: AutoRpcWallet, mut db:
AutoReconnectDb, state: &WireState
return Err(LoopError::Concurrency);
}
+ // Get stored sync state
+ let row = db.query_one("SELECT value FROM state WHERE
name='sync'", &[])?;
+ let sync_state = SyncState::from_bytes(&sql_array(&row, 0));
+
+ // Get changes
+ let list = rpc.list_since_sync(&state.address, sync_state,
state.confirmation)?;
+
+ // Perform analysis
+ state.confirmation =
+ analysis(list.fork_len, state.confirmation,
state.max_confirmations)?;
+
// Sync chain
- if sync_chain(rpc, db, state, &mut status)? {
+ if sync_chain(db, &state, &mut status, list)? {
// As we are now in sync with the blockchain if a transaction
has Requested status it have not been sent
// Send requested debits
- while debit(db, rpc, state)? {}
+ while debit(db, rpc, &state)? {}
// Bump stuck transactions
- while bump(db, rpc, state)? {}
+ while bump(db, rpc, &state)? {}
// Send requested bounce
while bounce(db, rpc, state.bounce_fee)? {}
@@ -124,18 +135,13 @@ pub fn worker(mut rpc: AutoRpcWallet, mut db:
AutoReconnectDb, state: &WireState
/// Parse new transactions, return true if the database is up to date with the
latest mined block
fn sync_chain(
- rpc: &mut Rpc,
db: &mut Client,
state: &WireState,
status: &mut bool,
+ list: ListSinceSync,
) -> LoopResult<bool> {
- // Get stored sync state
- let row = db.query_one("SELECT value FROM state WHERE name='sync'", &[])?;
- let sync_state = SyncState::from_bytes(&sql_array(&row, 0));
- // Use the same confirmation delay for this sync
- let conf_delay = state.confirmation.load(Ordering::SeqCst);
-
- let list = rpc.list_since_sync(&state.address, sync_state, conf_delay)?;
+ // Get the current confirmation delay
+ let conf_delay = state.confirmation;
// Check if a confirmed incoming transaction have been removed by a
blockchain reorganization
let new_status = sync_chain_removed(&list.txs, &list.removed, db,
&state.address, conf_delay)?;
diff --git a/eth-wire/src/main.rs b/eth-wire/src/main.rs
index 5ef5a74..287cfd3 100644
--- a/eth-wire/src/main.rs
+++ b/eth-wire/src/main.rs
@@ -29,7 +29,7 @@ use eth_wire::{
SyncState, WireState,
};
use ethereum_types::H160;
-use loops::{analysis::analysis, watcher::watcher, worker::worker, LoopResult};
+use loops::{watcher::watcher, worker::worker, LoopResult};
mod fail_point;
mod loops;
@@ -142,21 +142,14 @@ fn init(config: Option<PathBuf>, init: Init) ->
LoopResult<()> {
fn run(config: Option<PathBuf>) {
let state = WireState::load_taler_config(config.as_deref());
- let state: &'static _ = Box::leak(Box::new(state));
let rpc_worker = auto_rpc_wallet(state.ipc_path.clone(), state.address);
- let rpc_analysis = auto_rpc_common(state.ipc_path.clone());
let rpc_watcher = auto_rpc_common(state.ipc_path.clone());
let db_watcher = auto_reconnect_db(state.db_config.clone());
- let db_analysis = auto_reconnect_db(state.db_config.clone());
let db_worker = auto_reconnect_db(state.db_config.clone());
named_spawn("watcher", move || watcher(rpc_watcher, db_watcher));
- named_spawn("analysis", move || {
- analysis(rpc_analysis, db_analysis, state)
- });
-
worker(rpc_worker, db_worker, state);
info!("eth-wire stopped");
}
diff --git a/instrumentation/src/btc.rs b/instrumentation/src/btc.rs
index a21fa42..cfe113a 100644
--- a/instrumentation/src/btc.rs
+++ b/instrumentation/src/btc.rs
@@ -18,7 +18,6 @@ use std::{
ops::{Deref, DerefMut},
path::{Path, PathBuf},
str::FromStr,
- sync::atomic::Ordering,
thread::sleep,
time::Duration,
};
@@ -346,7 +345,6 @@ impl BtcCtx {
.unwrap();
common_rpc.mine(1, &reserve_addr).unwrap();
- let conf = state.confirmation.load(Ordering::SeqCst) as u16;
Self {
common,
btc_node,
@@ -357,8 +355,8 @@ impl BtcCtx {
wire_addr,
client_addr,
reserve_addr,
+ conf: state.confirmation as u16,
state,
- conf,
_btc_node2: btc_node2,
common_rpc2,
}
@@ -981,6 +979,7 @@ fn analysis() {
// Recover orphaned transaction
ctx.next_conf();
+ ctx.next_block(); // Conf have changed
ctx.expect_wire_balance(after, false);
ctx.expect_gateway_up();
@@ -996,6 +995,7 @@ fn analysis() {
ctx.expect_gateway_up();
ctx.cluster_fork(5);
ctx.expect_wire_balance(before, false);
+ std::thread::sleep(Duration::from_secs(3)); // Give some time for the
gateway to be down
ctx.expect_gateway_up();
}
diff --git a/instrumentation/src/eth.rs b/instrumentation/src/eth.rs
index f2bc517..b0a634d 100644
--- a/instrumentation/src/eth.rs
+++ b/instrumentation/src/eth.rs
@@ -18,7 +18,6 @@ use std::{
io::Write,
ops::{Deref, DerefMut},
path::Path,
- sync::atomic::Ordering,
thread::sleep,
time::Duration,
};
@@ -356,7 +355,6 @@ impl EthCtx {
for addr in [&client_addr, &reserve_addr] {
rpc.unlock_account(addr, &passwd).unwrap();
}
- let conf = state.confirmation.load(Ordering::SeqCst) as u16;
Self {
node,
@@ -364,9 +362,9 @@ impl EthCtx {
reserve_addr,
client_addr,
wire_addr,
+ conf: state.confirmation as u16,
state,
common,
- conf,
passwd,
}
}
@@ -981,7 +979,7 @@ fn analysis() {
// Perform fork and check eth-wire hard error
ctx.expect_gateway_up();
- ctx.cluster_fork(6);
+ ctx.cluster_fork(5);
ctx.expect_wire_balance(before, false);
ctx.expect_gateway_down();
@@ -1002,6 +1000,7 @@ fn analysis() {
ctx.expect_gateway_up();
ctx.cluster_fork(5);
ctx.expect_wire_balance(before, false);
+ std::thread::sleep(Duration::from_secs(3));
ctx.expect_gateway_up();
}
diff --git a/wire-gateway/Cargo.toml b/wire-gateway/Cargo.toml
index 0fd2e00..ea7f250 100644
--- a/wire-gateway/Cargo.toml
+++ b/wire-gateway/Cargo.toml
@@ -15,7 +15,7 @@ tokio = { version = "1.21.1", features = ["net", "macros",
"rt-multi-thread"] }
# Serialization framework
serde = { version = "1.0.144", features = ["derive"] }
# Serialization helper
-serde_with = "2.0.1"
+serde_with = "1.14.0"
# JSON serialization
serde_json = "1.0.85"
# Url query serialization
@@ -25,7 +25,7 @@ thiserror = "1.0.35"
# Deflate compression
miniz_oxide = "0.6.2"
# Async postgres client
-tokio-postgres = { version = "0.7.7" }
+tokio-postgres = { version = "=0.7.6" }
deadpool-postgres = "0.10.2"
# Socket activation
listenfd = "1.0.0"
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-depolymerization] branch master updated (83c8149 -> 9631a53),
gnunet <=