stratum-mining / stratum

stratum
https://stratumprotocol.org
Other
218 stars 126 forks source link

Consider using internal crates without versioning #1189

Open jbesraa opened 2 weeks ago

jbesraa commented 2 weeks ago

Currently when importing protocol crates or others into a role or other protocol crate, we specify the version. I think it would make more sense to import internal crates without versioning, this way we know that all of our crates are using latest code we push.

For example, jd-client cargo.toml looks like the following:

[dependencies]
stratum-common = { version = "1.0.0", 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 = "^1.0.1", path = "../../protocols/v2/codec-sv2", features = ["noise_sv2", "with_buffer_pool"] }
framing_sv2 = { version = "^2.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" }
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" }
nohash-hasher = "0.2.0"
key-utils = { version = "^1.0.0", path = "../../utils/key-utils" }

I propose to change it to:

[dependencies]
stratum-common = { path = "../../common" }
async-channel = "1.5.1"
async-recursion = "0.3.2"
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 = { path = "../../utils/error-handling" }
nohash-hasher = "0.2.0"
key-utils = { path = "../../utils/key-utils" }
plebhash commented 2 weeks ago

ACK

for now I think this makes sense and avoids potential confusion

however, once we split roles into a new repo this will change again

we should probably fetch those from crates.io when that happens, but that's a future discussion