Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Binary_sv2 refactor #1463

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/workflows/coverage-protocols.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ jobs:
file: ./protocols/target/tarpaulin-reports/binary-sv2-coverage/cobertura.xml
flags: binary_sv2-coverage
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload binary_serde_sv2-coverage to codecov.io
uses: codecov/codecov-action@v4
with:
directory: ./protocols/target/tarpaulin-reports/serde-sv2-coverage
file: ./protocols/target/tarpaulin-reports/serde-sv2-coverage/cobertura.xml
flags: binary_serde_sv2-coverage
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload codec_sv2-coverage to codecov.io
uses: codecov/codecov-action@v4
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,19 @@ jobs:
cd utils/buffer
cargo doc

- name: Rust Docs crate no_serde_sv2_derive_codec
- name: Rust Docs crate binary_sv2 derive_codec
run: |
cd protocols/v2/binary-sv2/no-serde-sv2/derive_codec
cd protocols/v2/binary-sv2/derive_codec
cargo doc

- name: Rust Docs crate no_serde_sv2_codec
- name: Rust Docs crate binary_sv2 codec
run: |
cd protocols/v2/binary-sv2/no-serde-sv2/codec
cd protocols/v2/binary-sv2/codec
cargo doc --features with_buffer_pool

- name: Rust Docs crate serde_sv2
run: |
cd protocols/v2/binary-sv2/serde-sv2
cargo doc

- name: Rust Docs crate binary_sv2
run: |
cd protocols/v2/binary-sv2/binary-sv2
cd protocols/v2/binary-sv2
cargo doc --features core,with_buffer_pool

- name: Rust Docs crate const_sv2
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/release-libs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,17 @@ jobs:
run: |
./scripts/release-libs.sh utils/buffer

- name: Publish crate no_serde_sv2_derive_codec
- name: Publish crate binary_sv2 derive_codec
run: |
./scripts/release-libs.sh protocols/v2/binary-sv2/no-serde-sv2/derive_codec
./scripts/release-libs.sh protocols/v2/binary-sv2/derive_codec

- name: Publish crate no_serde_sv2_codec
- name: Publish crate binary_sv2 codec
run: |
./scripts/release-libs.sh protocols/v2/binary-sv2/no-serde-sv2/codec

- name: Publish crate serde_sv2
run: |
./scripts/release-libs.sh protocols/v2/binary-sv2/serde-sv2
./scripts/release-libs.sh protocols/v2/binary-sv2/codec

- name: Publish crate binary_sv2
run: |
./scripts/release-libs.sh protocols/v2/binary-sv2/binary-sv2
./scripts/release-libs.sh protocols/v2/binary-sv2

- name: Publish crate const_sv2
run: |
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/semver-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,12 @@ jobs:
working-directory: utils/buffer
run: cargo semver-checks

- name: Run semver checks for protocols/v2/binary-sv2/no-serde-sv2/codec
working-directory: protocols/v2/binary-sv2/no-serde-sv2/codec
- name: Run semver checks for protocols/v2/binary-sv2/codec
working-directory: protocols/v2/binary-sv2/codec
run: cargo semver-checks

- name: Run semver checks for protocols/v2/binary-sv2/serde-sv2
working-directory: protocols/v2/binary-sv2/serde-sv2
run: cargo semver-checks

- name: Run semver checks for protocols/v2/binary-sv2/binary-sv2
working-directory: protocols/v2/binary-sv2/binary-sv2
- name: Run semver checks for protocols/v2/binary-sv2
working-directory: protocols/v2/binary-sv2
run: cargo semver-checks

- name: Run semver checks for protocols/v2/const-sv2
Expand Down
2 changes: 1 addition & 1 deletion benches/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ num-bigint = "0.4.3"
num-traits = "0.2.15"
bitcoin="0.28.1"
codec_sv2 = { path = "../protocols/v2/codec-sv2", features=["noise_sv2"] }
binary_sv2 = { path = "../protocols/v2/binary-sv2/binary-sv2" }
binary_sv2 = { path = "../protocols/v2/binary-sv2" }
network_helpers_sv2 = { path = "../roles/roles-utils/network-helpers" }
rand = "0.8.4"

Expand Down
8 changes: 4 additions & 4 deletions examples/interop-cpp-no-cargo/rust-build-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rustc \
rustc \
--crate-name binary_codec_sv2 \
--edition=2018 \
$ROOT/binary-sv2/no-serde-sv2/codec/src/lib.rs \
$ROOT/binary-sv2/codec/src/lib.rs \
--error-format=json \
--json=diagnostic-rendered-ansi \
--crate-type lib \
Expand All @@ -40,7 +40,7 @@ rustc \
rustc \
--crate-name binary_codec_sv2 \
--edition=2018 \
$ROOT/binary-sv2/no-serde-sv2/codec/src/lib.rs \
$ROOT/binary-sv2/codec/src/lib.rs \
--error-format=json \
--json=diagnostic-rendered-ansi,artifacts \
--crate-type lib \
Expand All @@ -66,7 +66,7 @@ rustc \
rustc \
--crate-name derive_codec_sv2 \
--edition=2018 \
$ROOT/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs \
$ROOT/binary-sv2/derive_codec/src/lib.rs \
--error-format=json \
--json=diagnostic-rendered-ansi \
--crate-type proc-macro \
Expand All @@ -82,7 +82,7 @@ rustc \
rustc \
--crate-name binary_sv2 \
--edition=2018 \
$ROOT/binary-sv2/binary-sv2/src/lib.rs \
$ROOT/binary-sv2/src/lib.rs \
--error-format=json \
--json=diagnostic-rendered-ansi,artifacts \
--crate-type lib \
Expand Down
2 changes: 1 addition & 1 deletion examples/interop-cpp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ publish = false
[dependencies]
codec_sv2 = { path = "../../protocols/v2/codec-sv2" }
const_sv2 = { path = "../../protocols/v2/const-sv2" }
binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" }
binary_sv2 = { path = "../../protocols/v2/binary-sv2" }
common_messages_sv2 = { path = "../../protocols/v2/subprotocols/common-messages" }
template_distribution_sv2 = { path = "../../protocols/v2/subprotocols/template-distribution" }
2 changes: 1 addition & 1 deletion examples/ping-pong-encrypted/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [ "SRI Community" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" }
binary_sv2 = { path = "../../protocols/v2/binary-sv2" }
codec_sv2 = { path = "../../protocols/v2/codec-sv2", features = [ "noise_sv2" ] }
noise_sv2 = { path = "../../protocols/v2/noise-sv2" }
key-utils = { version = "^1.0.0", path = "../../utils/key-utils" }
Expand Down
2 changes: 1 addition & 1 deletion examples/ping-pong/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ authors = [ "SRI Community" ]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
binary_sv2 = { path = "../../protocols/v2/binary-sv2/binary-sv2" }
binary_sv2 = { path = "../../protocols/v2/binary-sv2" }
codec_sv2 = { path = "../../protocols/v2/codec-sv2" }

rand = "0.8"
6 changes: 2 additions & 4 deletions protocols/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ resolver="2"

members = [
"v1",
"v2/binary-sv2/serde-sv2",
"v2/binary-sv2/no-serde-sv2/codec",
"v2/binary-sv2/no-serde-sv2/derive_codec",
"v2/binary-sv2/binary-sv2",
"v2/binary-sv2/derive_codec",
"v2/binary-sv2",
"v2/noise-sv2",
"v2/framing-sv2",
"v2/codec-sv2",
Expand Down
2 changes: 1 addition & 1 deletion protocols/fuzz-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ cargo-fuzz = true
libfuzzer-sys = { version = "0.4.0", features = ["arbitrary-derive"] }
arbitrary = { version = "1", features = ["derive"] }
rand = "0.8.3"
binary_codec_sv2 = { path = "../v2/binary-sv2/no-serde-sv2/codec"}
binary_codec_sv2 = { path = "../v2/binary-sv2/codec"}
codec_sv2 = { path = "../v2/codec-sv2", features = ["noise_sv2"]}
roles_logic_sv2 = { path = "../v2/roles-logic-sv2"}
affinity = "0.1.1"
Expand Down
2 changes: 1 addition & 1 deletion protocols/v1/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = { path = "../v2/binary-sv2/binary-sv2" }
binary_sv2 = { path = "../v2/binary-sv2" }

[dev-dependencies]
quickcheck = "1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "binary_codec_sv2"
version = "1.2.0"
name = "binary_sv2"
version = "2.0.0"
authors = ["The Stratum V2 Developers"]
edition = "2018"
readme = "README.md"
description = "Sv2 data format"
documentation = "https://docs.rs/binary_codec_sv2"
documentation = "https://docs.rs/binary_sv2"
license = "MIT OR Apache-2.0"
repository = "https://github.com/stratum-mining/stratum"
homepage = "https://stratumprotocol.org"
Expand All @@ -14,14 +14,11 @@ 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 = { path = "../../../../../utils/buffer", optional=true }
derive_codec_sv2 = { path = "derive_codec" }

[features]
no_std = []
default = ["no_std"]
prop_test = ["quickcheck"]
with_buffer_pool = ["buffer_sv2"]
prop_test = []
with_buffer_pool = []

[package.metadata.docs.rs]
features = ["with_buffer_pool"]
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

## Features

- **with_serde**: Enables `serde`-based encoding and decoding.
- **core**: Activates non-`serde` implementations via `binary_codec_sv2` and `derive_codec_sv2`.(default)
- **prop_test**: Adds property testing support.
- **with_buffer_pool**: Optimizes memory usage during encoding.
Expand Down
30 changes: 0 additions & 30 deletions protocols/v2/binary-sv2/binary-sv2/Cargo.toml

This file was deleted.

Loading
Loading