enforce no_std for some protocol/v2 crates#1230
Conversation
|
| Branch | 1230/merge |
| Testbed | sv2 |
⚠️ WARNING: The following Measures do not have a Threshold. Without a Threshold, no Alerts will ever be generated!Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsCLI flag.
Click to view all benchmark results
| Benchmark | Estimated Cycles | estimated cycles | Instructions | instructions | L1 Accesses | accesses | L2 Accesses | accesses | RAM Accesses | accesses |
|---|---|---|---|---|---|---|---|---|---|---|
| client_sv2_handle_message_common | 📈 view plot | 2,073.00 | 📈 view plot | 473.00 | 📈 view plot | 733.00 | 📈 view plot | 9.00 | 📈 view plot | 37.00 |
| client_sv2_handle_message_mining | 📈 view plot | 8,178.00 | 📈 view plot | 2,137.00 | 📈 view plot | 3,158.00 | 📈 view plot | 38.00 | 📈 view plot | 138.00 |
| client_sv2_mining_message_submit_standard | 📈 view plot | 6,263.00 | 📈 view plot | 1,750.00 | 📈 view plot | 2,548.00 | 📈 view plot | 22.00 | 📈 view plot | 103.00 |
| client_sv2_mining_message_submit_standard_serialize | 📈 view plot | 14,694.00 | 📈 view plot | 4,694.00 | 📈 view plot | 6,754.00 | 📈 view plot | 48.00 | 📈 view plot | 220.00 |
| client_sv2_mining_message_submit_standard_serialize_deserialize | 📈 view plot | 27,746.00 | 📈 view plot | 10,645.00 | 📈 view plot | 15,506.00 | 📈 view plot | 89.00 | 📈 view plot | 337.00 |
| client_sv2_open_channel | 📈 view plot | 4,413.00 | 📈 view plot | 1,461.00 | 📈 view plot | 2,158.00 | 📈 view plot | 10.00 | 📈 view plot | 63.00 |
| client_sv2_open_channel_serialize | 📈 view plot | 14,024.00 | 📈 view plot | 5,064.00 | 📈 view plot | 7,324.00 | 📈 view plot | 38.00 | 📈 view plot | 186.00 |
| client_sv2_open_channel_serialize_deserialize | 📈 view plot | 22,832.00 | 📈 view plot | 8,040.00 | 📈 view plot | 11,687.00 | 📈 view plot | 87.00 | 📈 view plot | 306.00 |
| client_sv2_setup_connection | 📈 view plot | 4,659.00 | 📈 view plot | 1,502.00 | 📈 view plot | 2,274.00 | 📈 view plot | 15.00 | 📈 view plot | 66.00 |
| client_sv2_setup_connection_serialize | 📈 view plot | 16,134.00 | 📈 view plot | 5,963.00 | 📈 view plot | 8,659.00 | 📈 view plot | 46.00 | 📈 view plot | 207.00 |
| client_sv2_setup_connection_serialize_deserialize | 📈 view plot | 35,670.00 | 📈 view plot | 14,888.00 | 📈 view plot | 21,880.00 | 📈 view plot | 98.00 | 📈 view plot | 380.00 |
|
| Branch | 1230/merge |
| Testbed | sv1 |
⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsCLI flag.
Click to view all benchmark results
| Benchmark | Latency | nanoseconds (ns) |
|---|---|---|
| client-submit-serialize | 📈 view plot | 6,748.30 |
| client-submit-serialize-deserialize | 📈 view plot | 7,707.10 |
| client-submit-serialize-deserialize-handle/client-submit-serialize-deserialize-handle | 📈 view plot | 8,377.50 |
| client-sv1-authorize-serialize-deserialize-handle/client-sv1-authorize-serialize-deserialize-handle | 📈 view plot | 943.45 |
| client-sv1-authorize-serialize-deserialize/client-sv1-authorize-serialize-deserialize | 📈 view plot | 675.37 |
| client-sv1-authorize-serialize/client-sv1-authorize-serialize | 📈 view plot | 262.34 |
| client-sv1-get-authorize/client-sv1-get-authorize | 📈 view plot | 156.57 |
| client-sv1-get-submit | 📈 view plot | 6,451.40 |
| client-sv1-get-subscribe/client-sv1-get-subscribe | 📈 view plot | 289.67 |
| client-sv1-subscribe-serialize-deserialize-handle/client-sv1-subscribe-serialize-deserialize-handle | 📈 view plot | 812.52 |
| client-sv1-subscribe-serialize-deserialize/client-sv1-subscribe-serialize-deserialize | 📈 view plot | 607.60 |
| client-sv1-subscribe-serialize/client-sv1-subscribe-serialize | 📈 view plot | 222.88 |
|
| Branch | 1230/merge |
| Testbed | sv1 |
⚠️ WARNING: The following Measures do not have a Threshold. Without a Threshold, no Alerts will ever be generated!Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the--ci-only-thresholdsCLI flag.
Click to view all benchmark results
| Benchmark | Estimated Cycles | estimated cycles | Instructions | instructions | L1 Accesses | accesses | L2 Accesses | accesses | RAM Accesses | accesses |
|---|---|---|---|---|---|---|---|---|---|---|
| get_authorize | 📈 view plot | 8,304.00 | 📈 view plot | 3,663.00 | 📈 view plot | 5,114.00 | 📈 view plot | 8.00 | 📈 view plot | 90.00 |
| get_submit | 📈 view plot | 95,226.00 | 📈 view plot | 59,263.00 | 📈 view plot | 85,076.00 | 📈 view plot | 49.00 | 📈 view plot | 283.00 |
| get_subscribe | 📈 view plot | 7,871.00 | 📈 view plot | 2,758.00 | 📈 view plot | 3,831.00 | 📈 view plot | 17.00 | 📈 view plot | 113.00 |
| serialize_authorize | 📈 view plot | 12,041.00 | 📈 view plot | 5,240.00 | 📈 view plot | 7,281.00 | 📈 view plot | 14.00 | 📈 view plot | 134.00 |
| serialize_deserialize_authorize | 📈 view plot | 24,452.00 | 📈 view plot | 9,786.00 | 📈 view plot | 13,787.00 | 📈 view plot | 40.00 | 📈 view plot | 299.00 |
| serialize_deserialize_handle_authorize | 📈 view plot | 30,171.00 | 📈 view plot | 11,989.00 | 📈 view plot | 16,951.00 | 📈 view plot | 61.00 | 📈 view plot | 369.00 |
| serialize_deserialize_handle_submit | 📈 view plot | 126,220.00 | 📈 view plot | 73,117.00 | 📈 view plot | 104,760.00 | 📈 view plot | 120.00 | 📈 view plot | 596.00 |
| serialize_deserialize_handle_subscribe | 📈 view plot | 27,761.00 | 📈 view plot | 9,577.00 | 📈 view plot | 13,521.00 | 📈 view plot | 69.00 | 📈 view plot | 397.00 |
| serialize_deserialize_submit | 📈 view plot | 114,825.00 | 📈 view plot | 67,894.00 | 📈 view plot | 97,370.00 | 📈 view plot | 68.00 | 📈 view plot | 489.00 |
| serialize_deserialize_subscribe | 📈 view plot | 23,052.00 | 📈 view plot | 8,129.00 | 📈 view plot | 11,427.00 | 📈 view plot | 43.00 | 📈 view plot | 326.00 |
| serialize_submit | 📈 view plot | 99,505.00 | 📈 view plot | 61,325.00 | 📈 view plot | 87,940.00 | 📈 view plot | 52.00 | 📈 view plot | 323.00 |
| serialize_subscribe | 📈 view plot | 11,176.00 | 📈 view plot | 4,111.00 | 📈 view plot | 5,696.00 | 📈 view plot | 18.00 | 📈 view plot | 154.00 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main stratum-mining/stratum#1230 +/- ##
==========================================
+ Coverage 19.30% 25.13% +5.83%
==========================================
Files 164 20 -144
Lines 10849 1134 -9715
==========================================
- Hits 2094 285 -1809
+ Misses 8755 849 -7906
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
03a2dae to
fc640a7
Compare
There was a problem hiding this comment.
While I think the general idea is very welcome, I think addressing https://github.com/stratum-mining/stratum/issues/1200 first would make more sense as it can potentially change how we approach this. I think in #1200 we should aim to provide a logger for std and no std env and then impl Debug manually, which would allow us to remove the debug feature IIUC whats going here
|
Current
So it's pseudo
Maybe this can be discussed in #1132 ? |
If I do it before stratum-mining/sv2-apps#16, when stratum-mining/sv2-apps#16 will remove |
no_std for all protocol/v2 cratesno_std for all? protocol/v2 crates
Yea I think stratum-mining/sv2-apps#16 shouldn't necessarily be about removing |
dfb23fe to
8ef9d5e
Compare
|
Actual This PR is not fixing this. CI does not see it because does not test it. |
|
Actual This PR is not fixing this. CI does not see it because does not test it. |
|
@Georges760 please note that we're aiming to deprecate I cannot give you a precise timeline but Q1 2025 would be my rough guess. I wonder if that would make this process simpler? |
It make sense, as it is already broken in binary_sv2 and framing_sv2 as stated above. So I understand the official/only codec way will be the "core" option ? Good |
|
So I stop here for this PR and open for reviews. |
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
as a follow up to stratum-mining#1230 and stratum-mining#1300
as a follow up to stratum-mining#1230 and stratum-mining#1300
as a follow up to stratum-mining#1230
no_std for all? protocol/v2 cratesno_std for some protocol/v2 crates
* 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>
Most of protocol/v2 crates are almost
no_std, as listed here.Having a lib crate that can be
no_stdorstdby the selection of a feature :#![cfg_attr(not(feature = "std"), no_std)]or the current implementation :
#![cfg_attr(feature = "no_std", no_std)]is only usefull if :
stdrelated dependency (for instancestd::vec::Vec)stdso we disable the functionalities usingstdIn some case we can replace the
stddep by itsallocequivalent if exists (alloc::vec::Vec) and we can keep the functionality inno_stdenvironement.Finally, a
stdbinary can use someno_stddependencies, but anno_stdbinary cannot use anystddeps. So making the low level crates allno_stdwill make them copamtible for every kind of binary (app).We should use the
stdfeature only if some functionality requiresstdand not have anyno_stdequivalent.As far as I tried all protocol/v2/ crates (libs) can be 100%
no_stda,d does not need thestd(orno_std) feature to optionally addstddep.This PR is targeting to get rid of
stddep without loosing any functionality or efficiency.Note: I will make 1 commit per crate to explain what and how I am doing it.
Note2: being
no_allocis another level of complexity for deep embedded system, which is not at all this PR concern.