diff --git a/benches/Cargo.toml b/benches/Cargo.toml index 36851342c..37db6243c 100644 --- a/benches/Cargo.toml +++ b/benches/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" async-std={version = "1.10.0", features = ["attributes"]} criterion = "0.5.1" async-channel = "1.4.0" -v1 = { path="../protocols/v1", package="sv1_api", version = "^1.0.0" } +v1 = { path="../protocols/v1", package="sv1_api" } serde_json = { version = "1.0.64", default-features = false, features = ["alloc"] } iai="0.1" -mining_sv2 = { path = "../protocols/v2/subprotocols/mining", version = "^2.0.0" } -roles_logic_sv2 = { path = "../protocols/v2/roles-logic-sv2", version = "^1.0.0" } -framing_sv2 = { version = "3.0.0", path = "../protocols/v2/framing-sv2" } +mining_sv2 = { path = "../protocols/v2/subprotocols/mining" } +roles_logic_sv2 = { path = "../protocols/v2/roles-logic-sv2" } +framing_sv2 = { path = "../protocols/v2/framing-sv2" } serde = { version = "1.0.89", default-features = false, features = ["derive", "alloc"] } num-bigint = "0.4.3" num-traits = "0.2.15" diff --git a/examples/ping-pong-with-noise/Cargo.toml b/examples/ping-pong-with-noise/Cargo.toml index 093a194fe..5ee756fe9 100644 --- a/examples/ping-pong-with-noise/Cargo.toml +++ b/examples/ping-pong-with-noise/Cargo.toml @@ -9,14 +9,14 @@ publish = false [dependencies] rand = "0.8.3" -serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true} +serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true } async-channel = "1.5.1" async-std="1.8.0" bytes = "1.0.1" -binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" } -codec_sv2 = { version = "^2.0.0", path = "../../protocols/v2/codec-sv2", features=["noise_sv2"] } -network_helpers_sv2 = { version = "^2.0.0", path = "../../roles/roles-utils/network-helpers", features=["async_std"] } -key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } +binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features=["noise_sv2"] } +network_helpers_sv2 = { path = "../../roles/roles-utils/network-helpers", features=["async_std"] } +key-utils = { path = "../../utils/key-utils" } [profile.dev] panic = "unwind" diff --git a/examples/template-provider-test/Cargo.toml b/examples/template-provider-test/Cargo.toml index 4384b0cf0..cb283fdb8 100644 --- a/examples/template-provider-test/Cargo.toml +++ b/examples/template-provider-test/Cargo.toml @@ -7,8 +7,8 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -codec_sv2 = { version = "2.0", path = "../../protocols/v2/codec-sv2", features=["noise_sv2"] } -roles_logic_sv2 = { version = "^0.1.0", path = "../../protocols/v2/roles-logic-sv2" } -network_helpers_sv2 = { version = "^0.1.0", path = "../../roles/roles-utils/network-helpers", features=["async_std"] } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features=["noise_sv2"] } +roles_logic_sv2 = { path = "../../protocols/v2/roles-logic-sv2" } +network_helpers_sv2 = { path = "../../roles/roles-utils/network-helpers", features=["async_std"] } async-channel = "1.5.1" -async-std={version = "1.8.0", features = ["attributes"]} +async-std={ version = "1.8.0", features = ["attributes"] } diff --git a/protocols/fuzz-tests/Cargo.toml b/protocols/fuzz-tests/Cargo.toml index 61ac1fd3a..aa312dc81 100644 --- a/protocols/fuzz-tests/Cargo.toml +++ b/protocols/fuzz-tests/Cargo.toml @@ -17,9 +17,9 @@ cargo-fuzz = true libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] } arbitrary = { version = "1", features = ["derive"] } rand = "0.8.3" -binary_codec_sv2 = { version = "1.0.0", path = "../v2/binary-sv2/no-serde-sv2/codec"} -codec_sv2 = { version = "2.0.0", path = "../v2/codec-sv2", features = ["noise_sv2"]} -roles_logic_sv2 = { version = "1.0.0", path = "../v2/roles-logic-sv2"} +binary_codec_sv2 = { path = "../v2/binary-sv2/no-serde-sv2/codec"} +codec_sv2 = { path = "../v2/codec-sv2", features = ["noise_sv2"]} +roles_logic_sv2 = { path = "../v2/roles-logic-sv2"} affinity = "0.1.1" threadpool = "1.8.1" lazy_static = "1.4.0" diff --git a/protocols/v1/Cargo.toml b/protocols/v1/Cargo.toml index a983e6748..3f81a6594 100644 --- a/protocols/v1/Cargo.toml +++ b/protocols/v1/Cargo.toml @@ -20,7 +20,7 @@ hex = "0.4.3" serde = { version = "1.0.89", default-features = false, features = ["derive", "alloc"] } serde_json = { version = "1.0.64", default-features = false, features = ["alloc"] } tracing = {version = "0.1"} -binary_sv2 = { version = "^1.0.0", path = "../v2/binary-sv2/binary-sv2"} +binary_sv2 = { path = "../v2/binary-sv2/binary-sv2" } [dev-dependencies] quickcheck = "1" diff --git a/protocols/v2/binary-sv2/binary-sv2/Cargo.toml b/protocols/v2/binary-sv2/binary-sv2/Cargo.toml index bb1522f2c..11ce007ca 100644 --- a/protocols/v2/binary-sv2/binary-sv2/Cargo.toml +++ b/protocols/v2/binary-sv2/binary-sv2/Cargo.toml @@ -14,10 +14,10 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -serde_sv2 = {version = "^2.0.0", path = "../serde-sv2", optional = true} +serde_sv2 = { path = "../serde-sv2", optional = true } serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true } -binary_codec_sv2 = {version = "^1.0.0", path = "../no-serde-sv2/codec", optional = true} -derive_codec_sv2 = {version = "^1.0.0", path = "../no-serde-sv2/derive_codec", optional = true} +binary_codec_sv2 = { path = "../no-serde-sv2/codec", optional = true } +derive_codec_sv2 = { path = "../no-serde-sv2/derive_codec", optional = true } tracing = { version = "0.1", default-features = false } [features] @@ -28,4 +28,4 @@ prop_test = ["binary_codec_sv2/prop_test", "derive_codec_sv2"] with_buffer_pool = ["binary_codec_sv2/with_buffer_pool", "derive_codec_sv2"] [package.metadata.docs.rs] -features = ["core", "with_buffer_pool"] \ No newline at end of file +features = ["core", "with_buffer_pool"] diff --git a/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml b/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml index 57d8878d9..5b588d4ac 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml +++ b/protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml @@ -14,8 +14,8 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -quickcheck = {version = "1.0.0", optional = true} -buffer_sv2 = { version = "^1.0.0", path = "../../../../../utils/buffer", optional=true} +quickcheck = { version = "1.0.0", optional = true } +buffer_sv2 = { path = "../../../../../utils/buffer", optional=true } [features] no_std = [] @@ -24,4 +24,4 @@ prop_test = ["quickcheck"] with_buffer_pool = ["buffer_sv2"] [package.metadata.docs.rs] -features = ["with_buffer_pool"] \ No newline at end of file +features = ["with_buffer_pool"] diff --git a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml index 142926fd9..0b1f9ae01 100644 --- a/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml +++ b/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -binary_codec_sv2 = {version = "^1.0.0", path="../codec"} +binary_codec_sv2 = { path="../codec"} [lib] proc-macro = true diff --git a/protocols/v2/binary-sv2/serde-sv2/Cargo.toml b/protocols/v2/binary-sv2/serde-sv2/Cargo.toml index 06eea1da8..e31aaec89 100644 --- a/protocols/v2/binary-sv2/serde-sv2/Cargo.toml +++ b/protocols/v2/binary-sv2/serde-sv2/Cargo.toml @@ -16,4 +16,4 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false } -buffer_sv2 = {version = "^1.0.0", path = "../../../../utils/buffer"} +buffer_sv2 = { path = "../../../../utils/buffer"} diff --git a/protocols/v2/codec-sv2/Cargo.toml b/protocols/v2/codec-sv2/Cargo.toml index 33c608d80..56a1d413e 100644 --- a/protocols/v2/codec-sv2/Cargo.toml +++ b/protocols/v2/codec-sv2/Cargo.toml @@ -13,16 +13,16 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", default-features = false, optional = true } -framing_sv2 = { version = "^3.0.0", path = "../../../protocols/v2/framing-sv2" } -noise_sv2 = { version = "1.0", path = "../../../protocols/v2/noise-sv2", default-features = false, optional = true } -binary_sv2 = { version = "1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2" } -const_sv2 = { version = "3.0.0", path = "../../../protocols/v2/const-sv2"} -buffer_sv2 = { version = "1.0.0", path = "../../../utils/buffer"} -rand = {version = "0.8.5", default-features = false } +framing_sv2 = { path = "../../../protocols/v2/framing-sv2" } +noise_sv2 = { path = "../../../protocols/v2/noise-sv2", default-features = false, optional = true } +binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2" } +const_sv2 = { path = "../../../protocols/v2/const-sv2"} +buffer_sv2 = { path = "../../../utils/buffer"} +rand = { version = "0.8.5", default-features = false } tracing = { version = "0.1"} [dev-dependencies] -key-utils = { version = "^1.0.0", path = "../../../utils/key-utils" } +key-utils = { path = "../../../utils/key-utils" } [features] default = ["std"] @@ -31,4 +31,4 @@ with_serde = ["binary_sv2/with_serde", "serde", "framing_sv2/with_serde", "buffe with_buffer_pool = ["framing_sv2/with_buffer_pool"] [package.metadata.docs.rs] -features = ["with_buffer_pool", "noise_sv2"] \ No newline at end of file +features = ["with_buffer_pool", "noise_sv2"] diff --git a/protocols/v2/framing-sv2/Cargo.toml b/protocols/v2/framing-sv2/Cargo.toml index 8ce6896eb..7e8fbda6a 100644 --- a/protocols/v2/framing-sv2/Cargo.toml +++ b/protocols/v2/framing-sv2/Cargo.toml @@ -15,12 +15,12 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", default-features = false, optional = true } -const_sv2 = { version = "^3.0.0", path = "../../../protocols/v2/const-sv2"} -binary_sv2 = { version = "^1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2" } -buffer_sv2 = { version = "^1.0.0", path = "../../../utils/buffer", optional=true } +const_sv2 = { path = "../../../protocols/v2/const-sv2" } +binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2" } +buffer_sv2 = { path = "../../../utils/buffer", optional=true } [dev-dependencies] -noise_sv2 = { version = "1.0", path = "../../../protocols/v2/noise-sv2"} +noise_sv2 = { path = "../../../protocols/v2/noise-sv2" } rand = "0.8.3" secp256k1 = { version = "0.28.2", default-features = false, features =["alloc","rand","rand-std"] } @@ -29,4 +29,4 @@ with_serde = ["binary_sv2/with_serde", "serde", "buffer_sv2?/with_serde"] with_buffer_pool = ["binary_sv2/with_buffer_pool", "buffer_sv2"] [package.metadata.docs.rs] -features = ["with_buffer_pool"] \ No newline at end of file +features = ["with_buffer_pool"] diff --git a/protocols/v2/noise-sv2/Cargo.toml b/protocols/v2/noise-sv2/Cargo.toml index dc72101a7..52810daa4 100644 --- a/protocols/v2/noise-sv2/Cargo.toml +++ b/protocols/v2/noise-sv2/Cargo.toml @@ -17,7 +17,7 @@ rand = {version = "0.8.5", default-features = false } aes-gcm = "0.10.2" chacha20poly1305 = "0.10.1" rand_chacha = { version = "0.3.1", default-features = false } -const_sv2 = { version = "^3.0.0", path = "../../../protocols/v2/const-sv2"} +const_sv2 = { path = "../../../protocols/v2/const-sv2"} [features] default = ["std"] diff --git a/protocols/v2/roles-logic-sv2/Cargo.toml b/protocols/v2/roles-logic-sv2/Cargo.toml index ecb17fe5d..983439fa2 100644 --- a/protocols/v2/roles-logic-sv2/Cargo.toml +++ b/protocols/v2/roles-logic-sv2/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "roles_logic_sv2" -version = "1.2.3" +version = "2.0.0" authors = ["The Stratum V2 Developers"] edition = "2018" description = "Common handlers for use within SV2 roles" @@ -13,15 +13,15 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -stratum-common = { version="1.0.0", path = "../../../common", features=["bitcoin"]} +stratum-common = { path = "../../../common", features=["bitcoin"]} serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true} -binary_sv2 = {version = "^1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2", default-features = true } -common_messages_sv2 = { path = "../../../protocols/v2/subprotocols/common-messages", version = "^3.0.0" } -mining_sv2 = { path = "../../../protocols/v2/subprotocols/mining", version = "^2.0.0" } -template_distribution_sv2 = { path = "../../../protocols/v2/subprotocols/template-distribution", version = "^2.0.0" } -job_declaration_sv2 = { path = "../../../protocols/v2/subprotocols/job-declaration", version = "^2.0.0" } -const_sv2 = { version = "^3.0.0", path = "../../../protocols/v2/const-sv2"} -framing_sv2 = { version = "^3.0.0", path = "../../../protocols/v2/framing-sv2" } +binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2", default-features = true } +common_messages_sv2 = { path = "../../../protocols/v2/subprotocols/common-messages" } +mining_sv2 = { path = "../../../protocols/v2/subprotocols/mining" } +template_distribution_sv2 = { path = "../../../protocols/v2/subprotocols/template-distribution" } +job_declaration_sv2 = { path = "../../../protocols/v2/subprotocols/job-declaration" } +const_sv2 = { path = "../../../protocols/v2/const-sv2"} +framing_sv2 = { path = "../../../protocols/v2/framing-sv2" } tracing = { version = "0.1"} chacha20poly1305 = { version = "0.10.1"} nohash-hasher = "0.2.0" diff --git a/protocols/v2/roles-logic-sv2/src/errors.rs b/protocols/v2/roles-logic-sv2/src/errors.rs index bd18eebc2..59f489987 100644 --- a/protocols/v2/roles-logic-sv2/src/errors.rs +++ b/protocols/v2/roles-logic-sv2/src/errors.rs @@ -113,6 +113,7 @@ pub enum Error { LogicErrorMessage(std::boxed::Box>), /// JD server cannot propagate the block due to missing transactions JDSMissingTransactions, + IoError(std::io::Error), } impl From for Error { @@ -121,6 +122,12 @@ impl From for Error { } } +impl From for Error { + fn from(v: std::io::Error) -> Error { + Error::IoError(v) + } +} + impl Display for Error { fn fmt(&self, f: &mut Formatter) -> fmt::Result { use Error::*; @@ -205,6 +212,7 @@ impl Display for Error { HashrateError(e) => write!(f, "Impossible to get Hashrate: {:?}", e), LogicErrorMessage(e) => write!(f, "Message is well formatted but can not be handled: {:?}", e), JDSMissingTransactions => write!(f, "JD server cannot propagate the block: missing transactions"), + IoError(e) => write!(f, "IO error: {:?}", e), } } } diff --git a/protocols/v2/subprotocols/common-messages/Cargo.toml b/protocols/v2/subprotocols/common-messages/Cargo.toml index c9d282f5c..49fb891a2 100644 --- a/protocols/v2/subprotocols/common-messages/Cargo.toml +++ b/protocols/v2/subprotocols/common-messages/Cargo.toml @@ -15,8 +15,8 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", default-features = false, optional = true } -binary_sv2 = { version = "^1.0.0", path = "../../binary-sv2/binary-sv2" } -const_sv2 = { version = "^3.0.0", path = "../../const-sv2" } +binary_sv2 = { path = "../../binary-sv2/binary-sv2" } +const_sv2 = { path = "../../const-sv2" } quickcheck = { version = "1.0.3", optional = true } quickcheck_macros = { version = "1", optional = true } serde_repr = { version= "0.1.10", optional = true } diff --git a/protocols/v2/subprotocols/job-declaration/Cargo.toml b/protocols/v2/subprotocols/job-declaration/Cargo.toml index e937c0792..49bfc9edf 100644 --- a/protocols/v2/subprotocols/job-declaration/Cargo.toml +++ b/protocols/v2/subprotocols/job-declaration/Cargo.toml @@ -14,8 +14,8 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", default-features = false, optional= true } -binary_sv2 = {version = "^1.0.0", path = "../../binary-sv2/binary-sv2" } -const_sv2 = {version = "^3.0.0", path = "../../const-sv2"} +binary_sv2 = { path = "../../binary-sv2/binary-sv2" } +const_sv2 = { path = "../../const-sv2" } [features] with_serde = ["binary_sv2/with_serde", "serde"] diff --git a/protocols/v2/subprotocols/mining/Cargo.toml b/protocols/v2/subprotocols/mining/Cargo.toml index bb1b82f86..6dd494f3f 100644 --- a/protocols/v2/subprotocols/mining/Cargo.toml +++ b/protocols/v2/subprotocols/mining/Cargo.toml @@ -16,8 +16,8 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", default-features = false, optional= true } -binary_sv2 = {version = "^1.0.0", path = "../../binary-sv2/binary-sv2" } -const_sv2 = {version = "^3.0.0", path = "../../const-sv2"} +binary_sv2 = { path = "../../binary-sv2/binary-sv2" } +const_sv2 = { path = "../../const-sv2"} [dev-dependencies] quickcheck = "1.0.3" diff --git a/protocols/v2/subprotocols/template-distribution/Cargo.toml b/protocols/v2/subprotocols/template-distribution/Cargo.toml index fdb90470e..a6a472604 100644 --- a/protocols/v2/subprotocols/template-distribution/Cargo.toml +++ b/protocols/v2/subprotocols/template-distribution/Cargo.toml @@ -15,8 +15,8 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] [dependencies] serde = { version = "1.0.89", default-features = false, optional= true } -binary_sv2 = { version = "^1.0.1", path = "../../binary-sv2/binary-sv2" } -const_sv2 = { version = "^3.0.0", path = "../../const-sv2"} +binary_sv2 = { path = "../../binary-sv2/binary-sv2" } +const_sv2 = { path = "../../const-sv2"} quickcheck = { version = "1.0.3", optional=true } quickcheck_macros = { version = "1", optional=true } diff --git a/protocols/v2/sv2-ffi/Cargo.toml b/protocols/v2/sv2-ffi/Cargo.toml index 8c861b4c8..e08931891 100644 --- a/protocols/v2/sv2-ffi/Cargo.toml +++ b/protocols/v2/sv2-ffi/Cargo.toml @@ -14,11 +14,11 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] crate-type = ["staticlib"] [dependencies] -codec_sv2 = { path = "../../../protocols/v2/codec-sv2", version = "^2.0.0" } -const_sv2 = { path = "../../../protocols/v2/const-sv2", version = "^3.0.0" } -binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2", version = "^1.0.0" } -common_messages_sv2 = { path = "../../../protocols/v2/subprotocols/common-messages", version = "^3.0.0" } -template_distribution_sv2 = { path = "../../../protocols/v2/subprotocols/template-distribution", version = "^2.0.0" } +codec_sv2 = { path = "../../../protocols/v2/codec-sv2" } +const_sv2 = { path = "../../../protocols/v2/const-sv2" } +binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2" } +common_messages_sv2 = { path = "../../../protocols/v2/subprotocols/common-messages" } +template_distribution_sv2 = { path = "../../../protocols/v2/subprotocols/template-distribution" } [dev-dependencies] quickcheck = "1.0.3" diff --git a/roles/Cargo.lock b/roles/Cargo.lock index 9bd7b25da..c676e28f1 100644 --- a/roles/Cargo.lock +++ b/roles/Cargo.lock @@ -2019,7 +2019,7 @@ dependencies = [ [[package]] name = "roles_logic_sv2" -version = "1.2.3" +version = "2.0.0" dependencies = [ "binary_sv2", "chacha20poly1305", diff --git a/roles/jd-client/Cargo.toml b/roles/jd-client/Cargo.toml index 97a36a654..6d3f50420 100644 --- a/roles/jd-client/Cargo.toml +++ b/roles/jd-client/Cargo.toml @@ -16,21 +16,21 @@ name = "jd_client" path = "src/lib/mod.rs" [dependencies] -stratum-common = { version = "1.0.0", path = "../../common" } +stratum-common = { path = "../../common" } async-channel = "1.5.1" async-recursion = "0.3.2" -binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" } -buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" } -codec_sv2 = { version = "^2.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] } -framing_sv2 = { version = "^3.0.0", path = "../../protocols/v2/framing-sv2" } -network_helpers_sv2 = { version = "2.0.0", path = "../roles-utils/network-helpers", features=["with_tokio", "with_buffer_pool"] } -roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" } +binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" } +buffer_sv2 = { path = "../../utils/buffer" } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] } +framing_sv2 = { path = "../../protocols/v2/framing-sv2" } +network_helpers_sv2 = { path = "../roles-utils/network-helpers", features=["with_tokio", "with_buffer_pool"] } +roles_logic_sv2 = { path = "../../protocols/v2/roles-logic-sv2" } serde = { version = "1.0.89", default-features = false, features = ["derive", "alloc"] } futures = "0.3.25" tokio = { version = "1", features = ["full"] } ext-config = { version = "0.14.0", features = ["toml"], package = "config" } tracing = { version = "0.1" } tracing-subscriber = { version = "0.3" } -error_handling = { version = "1.0.0", path = "../../utils/error-handling" } +error_handling = { path = "../../utils/error-handling" } nohash-hasher = "0.2.0" -key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } +key-utils = { path = "../../utils/key-utils" } diff --git a/roles/jd-client/src/lib/downstream.rs b/roles/jd-client/src/lib/downstream.rs index c5d49d304..592198fc4 100644 --- a/roles/jd-client/src/lib/downstream.rs +++ b/roles/jd-client/src/lib/downstream.rs @@ -682,7 +682,7 @@ pub async fn listen_for_downstream_mining( jd: Option>>, ) -> Result>, Error> { info!("Listening for downstream mining connections on {}", address); - let listner = TcpListener::bind(address).await.unwrap(); + let listner = TcpListener::bind(address).await?; if let Ok((stream, _)) = listner.accept().await { let responder = Responder::from_authority_kp( diff --git a/roles/jd-client/src/lib/mod.rs b/roles/jd-client/src/lib/mod.rs index ee8b4c111..307adeec3 100644 --- a/roles/jd-client/src/lib/mod.rs +++ b/roles/jd-client/src/lib/mod.rs @@ -337,7 +337,7 @@ impl JobDeclaratorClient { }; // Wait for downstream to connect - let downstream = downstream::listen_for_downstream_mining( + let downstream = match downstream::listen_for_downstream_mining( downstream_addr, Some(upstream), send_solution, @@ -351,7 +351,10 @@ impl JobDeclaratorClient { Some(jd.clone()), ) .await - .unwrap(); + { + Ok(d) => d, + Err(_e) => return, + }; TemplateRx::connect( SocketAddr::new(IpAddr::from_str(ip_tp.as_str()).unwrap(), port_tp), diff --git a/roles/jd-server/Cargo.toml b/roles/jd-server/Cargo.toml index 03549e6c9..744199f57 100644 --- a/roles/jd-server/Cargo.toml +++ b/roles/jd-server/Cargo.toml @@ -19,23 +19,23 @@ path = "src/lib/mod.rs" [dependencies] stratum-common = { version = "1.0.0", path = "../../common" } async-channel = "1.5.1" -binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" } -buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" } -codec_sv2 = { version = "^2.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2"] } -const_sv2 = { version = "^3.0.0", path = "../../protocols/v2/const-sv2" } -network_helpers_sv2 = { version = "2.0.0", path = "../roles-utils/network-helpers", features = ["with_tokio"] } -noise_sv2 = { version = "1.1.0", path = "../../protocols/v2/noise-sv2" } +binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" } +buffer_sv2 = { path = "../../utils/buffer" } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features = ["noise_sv2"] } +const_sv2 = { path = "../../protocols/v2/const-sv2" } +network_helpers_sv2 = { path = "../roles-utils/network-helpers", features = ["with_tokio"] } +noise_sv2 = { path = "../../protocols/v2/noise-sv2" } rand = "0.8.4" -roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" } +roles_logic_sv2 = { path = "../../protocols/v2/roles-logic-sv2" } tokio = { version = "1", features = ["full"] } ext-config = { version = "0.14.0", features = ["toml"], package = "config" } tracing = { version = "0.1" } tracing-subscriber = "0.3" -error_handling = { version = "1.0.0", path = "../../utils/error-handling" } +error_handling = { path = "../../utils/error-handling" } nohash-hasher = "0.2.0" serde_json = { version = "1.0", default-features = false, features = ["alloc","raw_value"] } serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false } hashbrown = { version = "0.11", default-features = false, features = ["ahash", "serde"] } -key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } -rpc_sv2 = { version = "1.0.0", path = "../roles-utils/rpc" } -hex = "0.4.3" \ No newline at end of file +key-utils = { path = "../../utils/key-utils" } +rpc_sv2 = { path = "../roles-utils/rpc" } +hex = "0.4.3" diff --git a/roles/mining-proxy/Cargo.toml b/roles/mining-proxy/Cargo.toml index 14a3037b7..d65ce49a6 100644 --- a/roles/mining-proxy/Cargo.toml +++ b/roles/mining-proxy/Cargo.toml @@ -17,21 +17,21 @@ name = "mining_proxy_sv2" path = "src/lib/mod.rs" [dependencies] -stratum-common = { version = "1.0.0", path = "../../common" } +stratum-common = { path = "../../common" } async-channel = "1.8.0" async-recursion = "0.3.2" -binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" } -buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" } -codec_sv2 = { version = "^2.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] } -const_sv2 = { version = "^3.0.0", path = "../../protocols/v2/const-sv2" } +binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" } +buffer_sv2 = { path = "../../utils/buffer" } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] } +const_sv2 = { path = "../../protocols/v2/const-sv2" } futures = "0.3.19" -network_helpers_sv2 = {version = "2.0.0", path = "../roles-utils/network-helpers", features = ["with_tokio","with_buffer_pool"] } +network_helpers_sv2 = { path = "../roles-utils/network-helpers", features = ["with_tokio","with_buffer_pool"] } once_cell = "1.12.0" -roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" } +roles_logic_sv2 = { path = "../../protocols/v2/roles-logic-sv2" } serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false } tokio = { version = "1", features = ["full"] } ext-config = { version = "0.14.0", features = ["toml"], package = "config" } tracing = {version = "0.1"} tracing-subscriber = {version = "0.3"} nohash-hasher = "0.2.0" -key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } +key-utils = { path = "../../utils/key-utils" } diff --git a/roles/pool/Cargo.toml b/roles/pool/Cargo.toml index f35fb839b..660c28b96 100644 --- a/roles/pool/Cargo.toml +++ b/roles/pool/Cargo.toml @@ -17,25 +17,25 @@ name = "pool_sv2" path = "src/lib/mod.rs" [dependencies] -stratum-common = { version = "1.0.0", path = "../../common" } +stratum-common = { path = "../../common" } async-channel = "1.5.1" -binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" } -buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" } -codec_sv2 = { version = "^2.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2"] } -const_sv2 = { version = "^3.0.0", path = "../../protocols/v2/const-sv2" } -network_helpers_sv2 = { version = "2.0.0", path = "../roles-utils/network-helpers", features =["with_tokio","with_buffer_pool"] } -noise_sv2 = { version = "1.1.0", path = "../../protocols/v2/noise-sv2" } +binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" } +buffer_sv2 = { path = "../../utils/buffer" } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features = ["noise_sv2"] } +const_sv2 = { path = "../../protocols/v2/const-sv2" } +network_helpers_sv2 = { path = "../roles-utils/network-helpers", features =["with_tokio","with_buffer_pool"] } +noise_sv2 = { path = "../../protocols/v2/noise-sv2" } rand = "0.8.4" -roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" } +roles_logic_sv2 = { path = "../../protocols/v2/roles-logic-sv2" } serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false } tokio = { version = "1", features = ["full"] } ext-config = { version = "0.14.0", features = ["toml"], package = "config" } tracing = { version = "0.1" } tracing-subscriber = "0.3" async-recursion = "1.0.0" -error_handling = { version = "1.0.0", path = "../../utils/error-handling" } +error_handling = { path = "../../utils/error-handling" } nohash-hasher = "0.2.0" -key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } +key-utils = { path = "../../utils/key-utils" } [dev-dependencies] hex = "0.4.3" diff --git a/roles/roles-utils/network-helpers/Cargo.toml b/roles/roles-utils/network-helpers/Cargo.toml index f3953d405..233a7c9e5 100644 --- a/roles/roles-utils/network-helpers/Cargo.toml +++ b/roles/roles-utils/network-helpers/Cargo.toml @@ -17,9 +17,9 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] async-std = { version = "1.8.0", optional = true } async-channel = { version = "1.8.0", optional = true } tokio = { version = "1", features = ["full"], optional = true } -binary_sv2 = { version = "^1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2", optional = true } -codec_sv2 = { version = "2.0.0", path = "../../../protocols/v2/codec-sv2", features=["noise_sv2"], optional = true } -const_sv2 = {version = "3.0.0", path = "../../../protocols/v2/const-sv2"} +binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2", optional = true } +codec_sv2 = { path = "../../../protocols/v2/codec-sv2", features=["noise_sv2"], optional = true } +const_sv2 = {path = "../../../protocols/v2/const-sv2"} serde = { version = "1.0.89", features = ["derive"], default-features = false, optional = true } tracing = { version = "0.1" } futures = "0.3.28" @@ -32,4 +32,4 @@ with_serde = ["binary_sv2/with_serde", "serde", "codec_sv2/with_serde"] with_buffer_pool = ["codec_sv2/with_buffer_pool"] [package.metadata.docs.rs] -all-features = true \ No newline at end of file +all-features = true diff --git a/roles/roles-utils/rpc/Cargo.toml b/roles/roles-utils/rpc/Cargo.toml index 129354cdb..58eef9a54 100644 --- a/roles/roles-utils/rpc/Cargo.toml +++ b/roles/roles-utils/rpc/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -stratum-common = { version = "1.0.0", path = "../../../common", features=["bitcoin"] } +stratum-common = { path = "../../../common", features=["bitcoin"] } serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false } serde_json = { version = "1.0", default-features = false, features = ["alloc","raw_value"] } hex = "0.4.3" @@ -24,4 +24,4 @@ hyper-util = { version = "0.1", features = ["full"] } http-body-util = "0.1" [package.metadata.docs.rs] -all-features = true \ No newline at end of file +all-features = true diff --git a/roles/test-utils/mining-device/Cargo.toml b/roles/test-utils/mining-device/Cargo.toml index 264af18f5..a10c7a467 100644 --- a/roles/test-utils/mining-device/Cargo.toml +++ b/roles/test-utils/mining-device/Cargo.toml @@ -20,18 +20,18 @@ path = "src/lib/mod.rs" [dependencies] -stratum-common = { version = "1.0.0", path = "../../../common" } -codec_sv2 = { version = "^2.0.0", path = "../../../protocols/v2/codec-sv2", features=["noise_sv2"] } -roles_logic_sv2 = { version = "1.0.0", path = "../../../protocols/v2/roles-logic-sv2" } -const_sv2 = { version = "3.0.0", path = "../../../protocols/v2/const-sv2" } +stratum-common = { path = "../../../common" } +codec_sv2 = { path = "../../../protocols/v2/codec-sv2", features=["noise_sv2"] } +roles_logic_sv2 = { path = "../../../protocols/v2/roles-logic-sv2" } +const_sv2 = { path = "../../../protocols/v2/const-sv2" } async-channel = "1.5.1" -binary_sv2 = { version = "1.0.0", path = "../../../protocols/v2/binary-sv2/binary-sv2" } -network_helpers_sv2 = { version = "2.0.0", path = "../../roles-utils/network-helpers", features=["tokio"] } -buffer_sv2 = { version = "1.0.0", path = "../../../utils/buffer"} +binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2" } +network_helpers_sv2 = { path = "../../roles-utils/network-helpers", features=["tokio"] } +buffer_sv2 = { path = "../../../utils/buffer"} async-recursion = "0.3.2" rand = "0.8.4" futures = "0.3.5" -key-utils = { version = "^1.0.0", path = "../../../utils/key-utils" } +key-utils = { path = "../../../utils/key-utils" } clap = { version = "^4.5.4", features = ["derive"] } tracing = { version = "0.1" } tracing-subscriber = "0.3" diff --git a/roles/translator/Cargo.toml b/roles/translator/Cargo.toml index 1d17a5e40..95b346396 100644 --- a/roles/translator/Cargo.toml +++ b/roles/translator/Cargo.toml @@ -20,17 +20,17 @@ name = "translator_sv2" path = "src/main.rs" [dependencies] -stratum-common = { version = "1.0.0", path = "../../common" } +stratum-common = { path = "../../common" } async-channel = "1.5.1" async-recursion = "0.3.2" async-std = { version = "1.12.0", features = ["attributes"] } -binary_sv2 = { version = "^1.0.0", path = "../../protocols/v2/binary-sv2/binary-sv2" } -buffer_sv2 = { version = "^1.0.0", path = "../../utils/buffer" } -codec_sv2 = { version = "^2.0.0", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] } -framing_sv2 = { version = "^3.0.0", path = "../../protocols/v2/framing-sv2" } -network_helpers_sv2 = { version = "2.0.0", path = "../roles-utils/network-helpers", features=["async_std", "with_buffer_pool"] } +binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" } +buffer_sv2 = { path = "../../utils/buffer" } +codec_sv2 = { path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] } +framing_sv2 = { path = "../../protocols/v2/framing-sv2" } +network_helpers_sv2 = { path = "../roles-utils/network-helpers", features=["async_std", "with_buffer_pool"] } once_cell = "1.12.0" -roles_logic_sv2 = { version = "^1.0.0", path = "../../protocols/v2/roles-logic-sv2" } +roles_logic_sv2 = { path = "../../protocols/v2/roles-logic-sv2" } serde = { version = "1.0.89", default-features = false, features = ["derive", "alloc"] } serde_json = { version = "1.0.64", default-features = false, features = ["alloc"] } futures = "0.3.25" @@ -38,9 +38,9 @@ tokio = { version = "1", features = ["full"] } ext-config = { version = "0.14.0", features = ["toml"], package = "config" } tracing = { version = "0.1" } tracing-subscriber = { version = "0.3" } -v1 = { version = "^1.0.0", path = "../../protocols/v1", package="sv1_api" } -error_handling = { version = "1.0.0", path = "../../utils/error-handling" } -key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } +v1 = { path = "../../protocols/v1", package="sv1_api" } +error_handling = { path = "../../utils/error-handling" } +key-utils = { path = "../../utils/key-utils" } tokio-util = { version = "0.7.10", features = ["codec"] } async-compat = "0.2.1" rand = "0.8.4" diff --git a/utils/message-generator/Cargo.toml b/utils/message-generator/Cargo.toml index b881811a1..81c9884c6 100644 --- a/utils/message-generator/Cargo.toml +++ b/utils/message-generator/Cargo.toml @@ -20,7 +20,7 @@ codec_sv2 = { version = "2.0.0", path = "../../protocols/v2/codec-sv2", features const_sv2 = { version = "3.0.0", path = "../../protocols/v2/const-sv2" } load_file = "1.0.1" network_helpers_sv2 = { version = "2.0.0", path = "../../roles/roles-utils/network-helpers", features = ["with_tokio","with_serde"] } -roles_logic_sv2 = { version = "1.0.0", path = "../../protocols/v2/roles-logic-sv2", features = ["with_serde"] } +roles_logic_sv2 = { version = "2.0.0", path = "../../protocols/v2/roles-logic-sv2", features = ["with_serde"] } v1 = { version = "^1.0.0", path = "../../protocols/v1", package="sv1_api" } serde = { version = "*", features = ["derive", "alloc"], default-features = false } serde_json = { version = "1.0", default-features = false, features = ["alloc"] }