diff --git a/Cargo.lock b/Cargo.lock index 8d0210c3f81..608b5f80466 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1240,8 +1240,8 @@ dependencies = [ [[package]] name = "dashcore" -version = "0.37.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.37.0#9cb1184f7a4e84b42c800006398520af1d559cf1" +version = "0.38.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.38.0#fcc7c2266df12a8fb4878e60d1e1b6f49990f5ed" dependencies = [ "anyhow", "base64-compat", @@ -1266,13 +1266,13 @@ dependencies = [ [[package]] name = "dashcore-private" -version = "0.37.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.37.0#9cb1184f7a4e84b42c800006398520af1d559cf1" +version = "0.38.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.38.0#fcc7c2266df12a8fb4878e60d1e1b6f49990f5ed" [[package]] name = "dashcore-rpc" -version = "0.37.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.37.0#9cb1184f7a4e84b42c800006398520af1d559cf1" +version = "0.38.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.38.0#fcc7c2266df12a8fb4878e60d1e1b6f49990f5ed" dependencies = [ "dashcore-rpc-json", "hex", @@ -1284,8 +1284,8 @@ dependencies = [ [[package]] name = "dashcore-rpc-json" -version = "0.37.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.37.0#9cb1184f7a4e84b42c800006398520af1d559cf1" +version = "0.38.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.38.0#fcc7c2266df12a8fb4878e60d1e1b6f49990f5ed" dependencies = [ "bincode", "dashcore", @@ -1298,8 +1298,8 @@ dependencies = [ [[package]] name = "dashcore_hashes" -version = "0.37.0" -source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.37.0#9cb1184f7a4e84b42c800006398520af1d559cf1" +version = "0.38.0" +source = "git+https://github.com/dashpay/rust-dashcore?tag=v0.38.0#fcc7c2266df12a8fb4878e60d1e1b6f49990f5ed" dependencies = [ "dashcore-private", "secp256k1", diff --git a/packages/rs-dpp/Cargo.toml b/packages/rs-dpp/Cargo.toml index 09a509111da..01657841cc1 100644 --- a/packages/rs-dpp/Cargo.toml +++ b/packages/rs-dpp/Cargo.toml @@ -29,7 +29,7 @@ dashcore = { git = "https://github.com/dashpay/rust-dashcore", features = [ "rand", "signer", "serde", -], default-features = false, tag = "v0.37.0" } +], default-features = false, tag = "v0.38.0" } env_logger = { version = "0.11" } getrandom = { version = "0.2", features = ["js"] } hex = { version = "0.4" } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 3b9bd54a61f..942e127ecf9 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -28,7 +28,7 @@ rand = "0.8.5" tempfile = "3.3.0" hex = "0.4.3" indexmap = { version = "2.2.6", features = ["serde"] } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.37.0" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.38.0" } dpp = { path = "../rs-dpp", features = ["abci"] } simple-signer = { path = "../simple-signer" } rust_decimal = "1.2.5" diff --git a/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs b/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs index 14320ad1d25..23c9238b796 100644 --- a/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs +++ b/packages/rs-drive-abci/src/execution/platform_events/core_based_updates/update_quorum_info/v0/mod.rs @@ -290,7 +290,7 @@ where ( *quorum_hash, VerificationQuorum { - public_key: validator_set.threshold_public_key().clone(), + public_key: *validator_set.threshold_public_key(), index: validator_set.quorum_index(), }, ) diff --git a/packages/rs-drive-abci/src/rpc/core.rs b/packages/rs-drive-abci/src/rpc/core.rs index 633132a489c..8a91bc11a86 100644 --- a/packages/rs-drive-abci/src/rpc/core.rs +++ b/packages/rs-drive-abci/src/rpc/core.rs @@ -168,9 +168,9 @@ macro_rules! retry { } let mut last_err = None; - for i in 0..MAX_RETRIES { + let result = (0..MAX_RETRIES).find_map(|i| { match $action { - Ok(result) => return Ok(result), + Ok(result) => Some(Ok(result)), Err(e) => { match e { dashcore_rpc::Error::JsonRpc( @@ -187,16 +187,19 @@ macro_rules! retry { }, ), ) => { + // Delay before next try last_err = Some(e); let delay = fibonacci(i + 2) * FIB_MULTIPLIER; std::thread::sleep(Duration::from_secs(delay)); + None } - _ => return Err(e), - }; + _ => Some(Err(e)), + } } } - } - Err(last_err.unwrap()) // Return the last error if all attempts fail + }); + + result.unwrap_or_else(|| Err(last_err.unwrap())) }}; } @@ -267,7 +270,7 @@ impl CoreRPCLike for DefaultCoreRPC { &self, height: Option, ) -> Result { - retry!(self.inner.get_quorum_listextended(height)) + retry!(self.inner.get_quorum_listextended_reversed(height)) } fn get_quorum_info( @@ -278,7 +281,7 @@ impl CoreRPCLike for DefaultCoreRPC { ) -> Result { retry!(self .inner - .get_quorum_info(quorum_type, hash, include_secret_key_share)) + .get_quorum_info_reversed(quorum_type, hash, include_secret_key_share)) } fn get_protx_diff_with_masternodes( diff --git a/packages/rs-sdk/Cargo.toml b/packages/rs-sdk/Cargo.toml index 1008a9b35ca..1bae8d268fa 100644 --- a/packages/rs-sdk/Cargo.toml +++ b/packages/rs-sdk/Cargo.toml @@ -38,7 +38,7 @@ envy = { version = "0.4.2", optional = true } futures = { version = "0.3.30" } derive_more = { version = "1.0", features = ["from"] } # dashcore-rpc is only needed for core rpc; TODO remove once we have correct core rpc impl -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.37.0" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.38.0" } lru = { version = "0.12.5", optional = true } bip37-bloom-filter = { git = "https://github.com/dashpay/rs-bip37-bloom-filter", branch = "develop" } zeroize = { version = "1.8", features = ["derive"] } @@ -95,7 +95,7 @@ offline-testing = ["mocks"] # Requires configuration of Dash Platform connectivity. # See [README.md] for more details. # -# Without this feature enabled, tests will use test vectors from `tests/vectors/` instead of connecting to live +# Without this feature enabled, tests will use test vectors from `tests/vectors/` instead of connecting to live # Dash Platform. # # If both `offline-testing` and `network-testing` are enabled, "offline-testing" will take precedence. diff --git a/packages/simple-signer/Cargo.toml b/packages/simple-signer/Cargo.toml index 97ad29d953a..08818166a8b 100644 --- a/packages/simple-signer/Cargo.toml +++ b/packages/simple-signer/Cargo.toml @@ -8,6 +8,6 @@ rust-version.workspace = true [dependencies] bincode = { version = "2.0.0-rc.3", features = ["serde"] } -dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.37.0" } +dashcore-rpc = { git = "https://github.com/dashpay/rust-dashcore", tag = "v0.38.0" } dpp = { path = "../rs-dpp", features = ["abci"] } base64 = { version = "0.22.1" }