-
Notifications
You must be signed in to change notification settings - Fork 141
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
enforce no_std
for some protocol/v2 crates
#1230
Conversation
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
Bencher Report
Click to view all benchmark results
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I think the general idea is very welcome, I think addressing #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 #1200, when #1200 will remove |
no_std
for all protocol/v2 cratesno_std
for all? protocol/v2 crates
Yea I think #1200 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 <[email protected]> * 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 <[email protected]> Co-authored-by: plebhash <[email protected]> Co-authored-by: plebhash <[email protected]> Co-authored-by: jbesraa <[email protected]> Co-authored-by: bit-aloo <[email protected]> Co-authored-by: Gabriele Vernetti <[email protected]> Co-authored-by: Pavlenex <[email protected]> Co-authored-by: RJ Rybarczyk <[email protected]> Co-authored-by: Sjors Provoost <[email protected]> Co-authored-by: devworlds <[email protected]> Co-authored-by: Georges Palauqui <[email protected]> Co-authored-by: Gary Krause <[email protected]> Co-authored-by: Oleg Akulov <[email protected]>
Most of protocol/v2 crates are almost
no_std
, as listed here.Having a lib crate that can be
no_std
orstd
by 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 :
std
related dependency (for instancestd::vec::Vec
)std
so we disable the functionalities usingstd
In some case we can replace the
std
dep by itsalloc
equivalent if exists (alloc::vec::Vec
) and we can keep the functionality inno_std
environement.Finally, a
std
binary can use someno_std
dependencies, but anno_std
binary cannot use anystd
deps. So making the low level crates allno_std
will make them copamtible for every kind of binary (app).We should use the
std
feature only if some functionality requiresstd
and not have anyno_std
equivalent.As far as I tried all protocol/v2/ crates (libs) can be 100%
no_std
a,d does not need thestd
(orno_std
) feature to optionally addstd
dep.This PR is targeting to get rid of
std
dep 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_alloc
is another level of complexity for deep embedded system, which is not at all this PR concern.