Skip to content

Commit 8303654

Browse files
AkulovOlegGitGab19plebhashjbesraaShourya742
authored
Merge main to nomium-main (#22)
* tp_authority_public_key update * lock version for cargo semver-checks * Use shorter relative path .. and fix some styling inconsistency * Rewrite docs in `common_messages_sv2` .. As part of the effort to improve Stratum V2 protocols docs, this commit aims to improves and make the documentation more comprehensive and accessible for contributors and end users alike. * Add README.md .. Use the template README used across the different Stratum V2 protocol crates to `common_messages_sv2` crate. * modify sv2.h to make it consistent with comments changes * Use shorter relative path * Add README file * Improve Job Declaration Documentation * Add README file * Use shorter paths * Improve `Template Distribution` subprotocol docs * modify sv2.h to make it consistent with comments changes * add binary-sv2 docs * add binary-sv2 readme.md * add binary-sv2 custom trait example * add binary-sv2 no-serde derive-codec docs * add binary-sv2 no-serde derive-codec readme * add binary-sv2 no-serde codec readme * add binary-sv2 no-serde codec docs * update sv2.h for binary_sv2 docs * change doc test in derive_codec * Minor warning and error grammar and typo fixes * bump jdc * Slice docs * Buffer docs * Lib WriteError, Write, Buffer docs * Back buffer pool docs * Front buffer pool docs * InnerMemory buffer pool docs * PoolMode docs * BufferPool docs * Top buffer_pool mod docs * Buffer pool examples * Top level crate docs + clean up * Update README * Sniffer::wait_for_message_type * fix unwrap on sv1-mining-device tcp connection.. Update roles/test-utils/mining-device-sv1/src/client.rs Co-authored-by: jbesraa <jbesraa@gmail.com> * remove redundant Drop implementation from ITF TemplateProvider * Add `translator_sv2` test * use macos-14 as macos runner * disable MG tproxy CI * Have JDS ping local mempool less frequently Otherwise Bitcoin Core -debug=rpc logging becomes too noisy. * Use shorter paths * Add README mining subprotocol * Rewrite mining subprotocol docs * Create a lib for `mining-sv2-proxy` * Add `mining-sv2-proxy` initializer * lock semver-checks to 37 while replacing MSRV with stable * bump serde_v2 major to 2.0.0.. since v37, cargo semver-checks enforces that removal of features are breaking changes therefore we need to update serde_v2 as a follow up to stratum-mining#1230 * bump binary_sv2 for serde_sv2 dependency.. since we bumpbed serde_sv2 to 2.0.0 * bump sv2_ffi for serde_sv2 dependency.. since we bumpted serde_sv2 to 2.0.0 * bump roles/Cargo.lock.. since we bumped serde_sv2 and binary_sv2 * bump const_sv2 major to 3.0.0.. since v37, cargo semver-checks enforces that removal of features are breaking changes therefore we need to update serde_v2 as a follow up to stratum-mining#1230 * bump noise_sv2 for const_sv2 dependency.. since we bumpbed const_sv2 to 3.0.0 * bump framing_sv2 for const_sv2 dependency.. since we bumpbed const_sv2 to 3.0.0 * bump codec_sv2 for const_sv2 dependency.. since we bumpbed const_sv2 to 3.0.0 * bump subprotocols for const_sv2 dependency.. since we bumpbed const_sv2 to 3.0.0 * bump sv2_ffi for const_sv2 dependency.. since we bumpbed const_sv2 to 3.0.0 * bump roles_logic_sv2 for const_sv2 dependency.. since we bumpbed const_sv2 to 3.0.0 * bump roles due to const_sv2 bump to 3.0.0 * bump framing_sv2 major to 3.0.0.. since v37, cargo semver-checks enforces that removal of features are breaking changes therefore we need to update framing_v2 as a follow up to stratum-mining#1230 * bump codec_sv2 for framing_sv2 dependency.. since we bumped framing_sv2 to 3.0.0 * bump framing_sv2 dendency version on roles_logic_sv2.. crate version has already been bumped before release. no need to bump again * bump roles due to framing_sv2 bump * bump benches due to framing_sv2 bump * bump message_generator_sv2 due to const_sv2 * change macos-14 to macos-13 * bump buffer_sv2.. as a follow up to stratum-mining#1230 * bump buffer_sv2 dep on roles/Cargo.lock * bump buffer_sv2 dep on utils/Cargo.lock * bump derive_codec_sv2.. as a consequence of stratum-mining#1231 * bump derive_codec_sv2 dep on roles/Cargo.lock * Add framing sv2 frame and handshake frame ex * /// -> // for private types+fns * framing mod doc cmts + clean * Add framing README * add codecov.yml to remove ci error * feat: update println! and eprintln! to info using tracing cargo. * Wait for `NewTemplate` message to arrive instead of failing if it is not there yet when we first check * ci: bump TP to 0.1.13 * test: increase TP log timestamp precision Also log rpc calls. * `common_messages_sv2` `job_declaration_sv2` `mining_sv2` `template_distribution_sv2`: remove the `no_std` feature and make them `#![no_std]` as they never use `std` anywhere. - bump their MAJOR version because of feature removal - bump the dependant crates PATCH version - updates docs * fix: clarify logging * remove readme field from Cargo.toml of crates that dont have a README.md * add release-libs.sh * release-libs.yaml use 1.75.0 toolchain * remove readme field from Cargo.toml of crates that dont have a README.md * avoid publishing protocols crates with all-features.. publishing with all-features is overengineering: - no_std is being deprecated - with_serde will be deprecated soon - for crates with relevant features, we specifically list them for publishing * min_ntime fix to use the one sent by TP * header_timestamp_value_assertion_in_new_extended_mining_job test addition * bump PATCH after timestamp-bug fix (stratum-mining#1324) * update lockfile after roles_logic patch * Test Pool role behavior if bad `coinbase_output`.. is provided * Remove bad pool config MG test * Move sniffer test to a separate file * Derive Clone+Debug for `JobDeclaratorClient` * Derive Clone+Debug for `JobDeclaratorServer` * Align all integration test start_* .. functions return signature * Make Sniffer::drop output more verbose * Add README.md to integration-tests * Move integration tests to separate GH action * Rename integration tests crate.. it's important to have a descriptive name for when this is published to crates.io * Modularize integration tests APIs.. into the following modules: - lib: with general purpose functions (e.g.: starters) - sniffer - template_provider * Remove redundant `TestPoolSv2`.. this struct is redundant and no other roles follow this pattern we can do the initialization inside `start_pool` * Fix variable naming on `wait_for_client`.. the `SocketAddr` is not a client, but the socket where we will listen to also, `listner` is a typo * Rename sniffer channel variables.. the original naming was confusing copypasta * Create `utils.rs` in `tests-integration` ..to hold utility functions used internaly only. * noise_sv2: keep current (std) API unchanged, add a no_std compliant API with `*_with_rng` and `*_with_now` * generate cargo lock --------- Co-authored-by: GitGab19 <gabriele.vernetti@protonmail.com> Co-authored-by: plebhash <147345153+plebhash@users.noreply.github.com> Co-authored-by: plebhash <plebhash@proton.me> Co-authored-by: jbesraa <jbesraa@gmail.com> Co-authored-by: bit-aloo <sshourya17@gmail.com> Co-authored-by: Gabriele Vernetti <62447440+GitGab19@users.noreply.github.com> Co-authored-by: Pavlenex <36959754+pavlenex@users.noreply.github.com> Co-authored-by: RJ Rybarczyk <rj@rybar.tech> Co-authored-by: Sjors Provoost <sjors@sprovoost.nl> Co-authored-by: devworlds <jeffluizblockchain@gmail.com> Co-authored-by: Georges Palauqui <georges.palauqui@gptechinno.com> Co-authored-by: Gary Krause <gary.krause@mara.com> Co-authored-by: Oleg Akulov <o.akulov@nomium.org>
1 parent 71814c1 commit 8303654

File tree

95 files changed

+2228
-1691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+2228
-1691
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
pull_request:
6+
branches:
7+
- main
8+
9+
name: Integration Tests
10+
11+
jobs:
12+
ci:
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
os:
17+
- ubuntu-latest
18+
include:
19+
- os: ubuntu-latest
20+
target: x86_64-unknown-linux-musl
21+
22+
steps:
23+
- name: Use stable toolchain
24+
uses: actions/checkout@v4
25+
with:
26+
profile: minimal
27+
toolchain: stable
28+
override: true
29+
30+
- name: Roles Integration Tests
31+
run: |
32+
cargo test --manifest-path=roles/Cargo.toml --verbose --test '*' -- --nocapture

.github/workflows/mg.yaml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@ on:
1111
- main
1212

1313
jobs:
14-
bad-pool-config-test:
15-
runs-on: ubuntu-latest
16-
steps:
17-
- name: Checkout repository
18-
uses: actions/checkout@v4
19-
- name: Install cargo-llvm-cov
20-
run: cargo install cargo-llvm-cov
21-
- name: Run bad-pool-config-test
22-
run: sh ./test/message-generator/test/bad-pool-config-test/bad-pool-config-test.sh
23-
2414
interop-jd-translator:
2515
runs-on: ubuntu-latest
2616
steps:
@@ -167,7 +157,6 @@ jobs:
167157
runs-on: ubuntu-latest
168158
if: always()
169159
needs: [
170-
bad-pool-config-test,
171160
interop-jd-translator,
172161
interop-proxy-with-multi-ups,
173162
interop-proxy-with-multi-ups-extended,
@@ -188,8 +177,7 @@ jobs:
188177
steps:
189178
- name: Aggregate Results
190179
run: |
191-
if [ "${{ needs.bad-pool-config-test.result }}" != "success" ] ||
192-
[ "${{ needs.interop-jd-translator.result }}" != "success" ] ||
180+
if [ "${{ needs.interop-jd-translator.result }}" != "success" ] ||
193181
[ "${{ needs.interop-proxy-with-multi-ups.result }}" != "success" ] ||
194182
[ "${{ needs.interop-proxy-with-multi-ups-extended.result }}" != "success" ] ||
195183
[ "${{ needs.jds-do-not-fail-on-wrong-tsdatasucc.result }}" != "success" ] ||
@@ -209,4 +197,4 @@ jobs:
209197
exit 1
210198
else
211199
echo "All MG tests completed successfully"
212-
fi
200+
fi
Lines changed: 49 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
# This workflow is used to publish SV2 crates to crates.io
2-
# The workflow tries to update all the library crates, so if a crate is not to updated, the step will fail
3-
# for that each step have continue-on-error set to true.
4-
# Since each step can fail, the output ot the action must be manually checked to make sure that all
5-
# the library intended to be published are published.
6-
# Running cargo release in the various workspace help to prepare the version number and everything.
7-
# ATTENTION
8-
# Is very important to check the output manually cause when too many crates are updated crates.io could fail
9-
# and ask to rerun the action later
2+
# the workflow tries to publish all the library crates by running scripts/release-libs.sh
3+
# in case the `cargo publish` command fails, the script returns 1 and the entire workflow fails
4+
# the only exception is when the `cargo publish` command fails because the crate has already
5+
# been published, in which case the workflow continues
106

117
name: Release Libs
128

@@ -28,117 +24,95 @@ jobs:
2824
- uses: actions/checkout@v4
2925
- uses: actions-rs/toolchain@v1
3026
with:
31-
toolchain: stable
27+
toolchain: 1.75.0
3228
override: true
3329
- name: Login
3430
run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }}
31+
3532
- name: Publish crate common
36-
continue-on-error: true
3733
run: |
38-
cd common
39-
cargo publish
34+
./scripts/release-libs.sh common
35+
4036
- name: Publish crate buffer_sv2
41-
continue-on-error: true
4237
run: |
43-
cd utils/buffer
44-
cargo publish
38+
./scripts/release-libs.sh utils/buffer
39+
4540
- name: Publish crate no_serde_sv2_derive_codec
46-
continue-on-error: true
4741
run: |
48-
cd protocols/v2/binary-sv2/no-serde-sv2/derive_codec
49-
cargo publish
42+
./scripts/release-libs.sh protocols/v2/binary-sv2/no-serde-sv2/derive_codec
43+
5044
- name: Publish crate no_serde_sv2_codec
51-
continue-on-error: true
5245
run: |
53-
cd protocols/v2/binary-sv2/no-serde-sv2/codec
54-
cargo publish
46+
./scripts/release-libs.sh protocols/v2/binary-sv2/no-serde-sv2/codec
47+
5548
- name: Publish crate serde_sv2
56-
continue-on-error: true
5749
run: |
58-
cd protocols/v2/binary-sv2/serde-sv2
59-
cargo publish
50+
./scripts/release-libs.sh protocols/v2/binary-sv2/serde-sv2
51+
6052
- name: Publish crate binary_sv2
61-
continue-on-error: true
6253
run: |
63-
cd protocols/v2/binary-sv2/binary-sv2
64-
cargo publish
54+
./scripts/release-libs.sh protocols/v2/binary-sv2/binary-sv2
55+
6556
- name: Publish crate const_sv2
66-
continue-on-error: true
6757
run: |
68-
cd protocols/v2/const-sv2
69-
cargo publish
58+
./scripts/release-libs.sh protocols/v2/const-sv2
59+
7060
- name: Publish crate framing_sv2
71-
continue-on-error: true
7261
run: |
73-
cd protocols/v2/framing-sv2
74-
cargo publish
62+
./scripts/release-libs.sh protocols/v2/framing-sv2
63+
7564
- name: Publish crate noise_sv2
76-
continue-on-error: true
7765
run: |
78-
cd protocols/v2/noise-sv2
79-
cargo publish
66+
./scripts/release-libs.sh protocols/v2/noise-sv2
67+
8068
- name: Publish crate codec_sv2
81-
continue-on-error: true
8269
run: |
83-
cd protocols/v2/codec-sv2
84-
cargo publish
70+
./scripts/release-libs.sh protocols/v2/codec-sv2
71+
8572
- name: Publish crate common_messages
86-
continue-on-error: true
8773
run: |
88-
cd protocols/v2/subprotocols/common-messages
89-
cargo publish
74+
./scripts/release-libs.sh protocols/v2/subprotocols/common-messages
75+
9076
- name: Publish crate job_declaration
91-
continue-on-error: true
9277
run: |
93-
cd protocols/v2/subprotocols/job-declaration
94-
cargo publish
78+
./scripts/release-libs.sh protocols/v2/subprotocols/job-declaration
79+
9580
- name: Publish crate mining
96-
continue-on-error: true
9781
run: |
98-
cd protocols/v2/subprotocols/mining
99-
cargo publish
82+
./scripts/release-libs.sh protocols/v2/subprotocols/mining
83+
10084
- name: Publish crate template_distribution
101-
continue-on-error: true
10285
run: |
103-
cd protocols/v2/subprotocols/template-distribution
104-
cargo publish
86+
./scripts/release-libs.sh protocols/v2/subprotocols/template-distribution
87+
10588
- name: Publish crate sv2_ffi
106-
continue-on-error: true
10789
run: |
108-
cd protocols/v2/sv2-ffi
109-
cargo publish --all-features
90+
./scripts/release-libs.sh protocols/v2/sv2-ffi
91+
11092
- name: Publish crate roles_logic_sv2
111-
continue-on-error: true
11293
run: |
113-
cd protocols/v2/roles-logic-sv2
114-
cargo publish
94+
./scripts/release-libs.sh protocols/v2/roles-logic-sv2
95+
11596
- name: Publish crate v1
116-
continue-on-error: true
11797
run: |
118-
cd protocols/v1
119-
cargo publish
98+
./scripts/release-libs.sh protocols/v1
99+
120100
- name: Publish crate bip32-key-derivation
121-
continue-on-error: true
122101
run: |
123-
cd utils/bip32-key-derivation
124-
cargo publish
102+
./scripts/release-libs.sh utils/bip32-key-derivation
103+
125104
- name: Publish crate error-handling
126-
continue-on-error: true
127105
run: |
128-
cd utils/error-handling
129-
cargo publish
106+
./scripts/release-libs.sh utils/error-handling
107+
130108
- name: Publish crate key-utils
131-
continue-on-error: true
132109
run: |
133-
cd utils/key-utils
134-
cargo publish
110+
./scripts/release-libs.sh utils/key-utils
111+
135112
- name: Publish crate network_helpers_sv2
136-
continue-on-error: true
137113
run: |
138-
cd roles/roles-utils/network-helpers
139-
cargo publish
114+
./scripts/release-libs.sh roles/roles-utils/network-helpers
115+
140116
- name: Publish crate rpc_sv2
141-
continue-on-error: true
142117
run: |
143-
cd roles/roles-utils/rpc
144-
cargo publish
118+
./scripts/release-libs.sh roles/roles-utils/rpc

.github/workflows/semver-check.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616
- name: Checkout repository
1717
uses: actions/checkout@v2
1818

19-
- name: Install Rust 1.75.0
19+
- name: Install Rust stable
2020
uses: actions-rs/toolchain@v1
2121
with:
22-
toolchain: 1.75.0
22+
toolchain: stable
2323
override: true
2424

2525
- name: Cache Cargo registry
@@ -42,7 +42,7 @@ jobs:
4242
run: sudo apt-get update && sudo apt-get install -y cmake
4343

4444
- name: Install cargo-semver-checks
45-
run: cargo install cargo-semver-checks --version 0.33.0 --locked
45+
run: cargo install cargo-semver-checks --version 0.37.0 --locked
4646

4747
- name: Run semver checks for common
4848
working-directory: common

.github/workflows/test.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ jobs:
1414
strategy:
1515
matrix:
1616
os:
17-
- macos-14
17+
- macos-13
1818
- ubuntu-latest
1919
include:
20-
- os: macos-14
20+
- os: macos-13
2121
target: x86_64-apple-darwin
2222
- os: ubuntu-latest
2323
target: x86_64-unknown-linux-musl
@@ -38,10 +38,6 @@ jobs:
3838
cargo build --manifest-path=roles/Cargo.toml
3939
cargo build --manifest-path=utils/Cargo.toml
4040
41-
- name: Roles Integration Tests
42-
run: |
43-
cargo test --manifest-path=roles/Cargo.toml --verbose --test '*' -- --nocapture
44-
4541
- name: Run sv1-client-and-server example
4642
run: |
4743
cargo run --manifest-path=examples/sv1-client-and-server/Cargo.toml --bin client_and_server -- 60

benches/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "benchmark"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2021"
55

66
[dependencies]
@@ -10,9 +10,9 @@ async-channel = "1.4.0"
1010
v1 = { path="../protocols/v1", package="sv1_api", version = "^1.0.0" }
1111
serde_json = { version = "1.0.64", default-features = false, features = ["alloc"] }
1212
iai="0.1"
13-
mining_sv2 = { path = "../protocols/v2/subprotocols/mining", version = "^1.0.0" }
13+
mining_sv2 = { path = "../protocols/v2/subprotocols/mining", version = "^2.0.0" }
1414
roles_logic_sv2 = { path = "../protocols/v2/roles-logic-sv2", version = "^1.0.0" }
15-
framing_sv2 = { version = "2.0.0", path = "../protocols/v2/framing-sv2" }
15+
framing_sv2 = { version = "3.0.0", path = "../protocols/v2/framing-sv2" }
1616
serde = { version = "1.0.89", default-features = false, features = ["derive", "alloc"] }
1717
num-bigint = "0.4.3"
1818
num-traits = "0.2.15"

codecov.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: auto
6+
threshold: 100%
7+
base: auto
8+
informational: false
9+
patch:
10+
default:
11+
target: auto
12+
threshold: 100%
13+
base: auto

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "binary_sv2"
3-
version = "1.2.0"
3+
version = "1.2.1"
44
authors = ["The Stratum V2 Developers"]
55
edition = "2018"
66
readme = "README.md"
@@ -14,7 +14,7 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"]
1414
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1515

1616
[dependencies]
17-
serde_sv2 = {version = "^1.0.0", path = "../serde-sv2", optional = true}
17+
serde_sv2 = {version = "^2.0.0", path = "../serde-sv2", optional = true}
1818
serde = { version = "1.0.89", features = ["derive", "alloc"], default-features = false, optional = true }
1919
binary_codec_sv2 = {version = "^1.0.0", path = "../no-serde-sv2/codec", optional = true}
2020
derive_codec_sv2 = {version = "^1.0.0", path = "../no-serde-sv2/derive_codec", optional = true}
@@ -28,4 +28,4 @@ prop_test = ["binary_codec_sv2/prop_test", "derive_codec_sv2"]
2828
with_buffer_pool = ["binary_codec_sv2/with_buffer_pool", "derive_codec_sv2"]
2929

3030
[package.metadata.docs.rs]
31-
all-features = true
31+
features = ["core", "with_buffer_pool"]

protocols/v2/binary-sv2/no-serde-sv2/codec/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ prop_test = ["quickcheck"]
2424
with_buffer_pool = ["buffer_sv2"]
2525

2626
[package.metadata.docs.rs]
27-
all-features = true
27+
features = ["with_buffer_pool"]

protocols/v2/binary-sv2/no-serde-sv2/derive_codec/Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "derive_codec_sv2"
3-
version = "1.1.0"
3+
version = "1.1.1"
44
authors = ["The Stratum V2 Developers"]
55
edition = "2018"
66
readme = "README.md"
@@ -18,6 +18,3 @@ binary_codec_sv2 = {version = "^1.0.0", path="../codec"}
1818

1919
[lib]
2020
proc-macro = true
21-
22-
[package.metadata.docs.rs]
23-
all-features = true

0 commit comments

Comments
 (0)