Skip to content

Commit 5496d8a

Browse files
authored
Merge pull request #1394 from GPTechinno/protocols-v2-no_std
Protocols v2 no_std support
2 parents 2763ece + 3d22194 commit 5496d8a

File tree

7 files changed

+8
-9
lines changed

7 files changed

+8
-9
lines changed

protocols/v2/binary-sv2/binary-sv2/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ serde_sv2 = { path = "../serde-sv2", optional = true }
1818
serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true }
1919
binary_codec_sv2 = { path = "../no-serde-sv2/codec", optional = true }
2020
derive_codec_sv2 = { path = "../no-serde-sv2/derive_codec", optional = true }
21-
tracing = { version = "0.1", default-features = false }
2221

2322
[features]
2423
default = ["core"]

protocols/v2/codec-sv2/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ binary_sv2 = { path = "../../../protocols/v2/binary-sv2/binary-sv2" }
1919
const_sv2 = { path = "../../../protocols/v2/const-sv2"}
2020
buffer_sv2 = { path = "../../../utils/buffer"}
2121
rand = { version = "0.8.5", default-features = false }
22-
tracing = { version = "0.1"}
22+
tracing = { version = "0.1", optional = true }
2323

2424
[dev-dependencies]
2525
key-utils = { path = "../../../utils/key-utils" }
2626

2727
[features]
2828
default = ["std"]
29-
std = ["noise_sv2?/std", "rand/std", "rand/std_rng"]
29+
std = ["noise_sv2?/std", "rand/std", "rand/std_rng", "dep:tracing"]
3030
with_serde = ["binary_sv2/with_serde", "serde", "framing_sv2/with_serde", "buffer_sv2/with_serde"]
3131
with_buffer_pool = ["framing_sv2/with_buffer_pool"]
3232

protocols/v2/codec-sv2/src/encoder.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use framing_sv2::framing::{Frame, HandShakeFrame};
3434
#[allow(unused_imports)]
3535
pub use framing_sv2::header::NOISE_HEADER_ENCRYPTED_SIZE;
3636

37-
#[cfg(feature = "noise_sv2")]
37+
#[cfg(feature = "tracing")]
3838
use tracing::error;
3939

4040
#[cfg(feature = "noise_sv2")]
@@ -144,6 +144,7 @@ impl<T: Serialize + GetSize> NoiseEncoder<T> {
144144

145145
// ENCODE THE SV2 FRAME
146146
let i: Sv2Frame<T, Slice> = item.try_into().map_err(|e| {
147+
#[cfg(feature = "tracing")]
147148
error!("Error while encoding 1 frame: {:?}", e);
148149
Error::FramingError(e)
149150
})?;
@@ -198,6 +199,7 @@ impl<T: Serialize + GetSize> NoiseEncoder<T> {
198199
fn while_handshaking(&mut self, item: Item<T>) -> Result<()> {
199200
// ENCODE THE SV2 FRAME
200201
let i: HandShakeFrame = item.try_into().map_err(|e| {
202+
#[cfg(feature = "tracing")]
201203
error!("Error while encoding 2 frame - while_handshaking: {:?}", e);
202204
Error::FramingError(e)
203205
})?;

protocols/v2/noise-sv2/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"]
1414
[dependencies]
1515
secp256k1 = { version = "0.28.2", default-features = false, features = ["hashes", "alloc", "rand"] }
1616
rand = {version = "0.8.5", default-features = false }
17-
aes-gcm = "0.10.2"
18-
chacha20poly1305 = "0.10.1"
17+
aes-gcm = { version = "0.10.2", features = ["alloc", "aes"], default-features = false }
18+
chacha20poly1305 = { version = "0.10.1", default-features = false, features = ["alloc"]}
1919
rand_chacha = { version = "0.3.1", default-features = false }
2020
const_sv2 = { path = "../../../protocols/v2/const-sv2"}
2121

roles/Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/buffer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"]
1414
[dependencies]
1515
criterion = {version = "0.3", optional = true}
1616
serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true }
17-
aes-gcm = "0.10.2"
17+
aes-gcm = { version = "0.10.2", features = ["alloc", "aes"], default-features = false }
1818

1919
[dev-dependencies]
2020
rand = "0.8.3"

0 commit comments

Comments
 (0)