stratum-mining / stratum Goto Github PK
View Code? Open in Web Editor NEWstratum
Home Page: https://stratumprotocol.org
License: Other
stratum
Home Page: https://stratumprotocol.org
License: Other
Intermediate phase of Realize Proxy. It consist in the realization of a proxy with all what is
needed in order to do an alpha trial of Sv2
We want to prioritize the alpha trial as feedbacks and reviews of what has been done is very much
needed.
Errors in the low level crates are not well designed. That because it would have been much more effective to
design them when the low level crates are functionally complete tested and used in other crates.
So all the Error(s) in the project must be refactored.
When running rustfmt
on the examples, the compiler complains that async features are not permitted in Rust 2015 and suggests to update the Cargo.toml to the 2018 edition. However, the Cargo.toml does specify the 2018 edition. I do not know where this discrepancy is originating from.
$ rustfmt examples/sv1-client-and-server/src/*
error[E0670]: `async fn` is not permitted in Rust 2015
--> /home/rrybarczyk/Dev/stratum-v2/stratum/examples/sv1-client-and-server/src/main.rs:43:1
|
43 | async fn server_pool() {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
= help: set `edition = "2018"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error[E0670]: `async fn` is not permitted in Rust 2015
--> /home/rrybarczyk/Dev/stratum-v2/stratum/examples/sv1-client-and-server/src/main.rs:55:9
|
55 | pub async fn new(stream: TcpStream) -> Arc<Mutex<Self>> {
| ^^^^^ to use `async fn`, switch to Rust 2018 or later
|
= help: set `edition = "2018"` in `Cargo.toml`
= note: for more on editions, read https://doc.rust-lang.org/edition-guide
error: expected one of `!`, `)`, `,`, `.`, `::`, `?`, `{`, or an operator, found keyword `move`
--> /home/rrybarczyk/Dev/stratum-v2/stratum/examples/sv1-client-and-server/src/main.rs:63:27
|
63 | task::spawn(async move {
| ^^^^ expected one of 8 possible tokens
To solve this issue, the reason for edition discrepancy needs to be found and fixed, then the rustfmt
lint action needs to be added to .github/workflows/rust.yaml
for each example.
The crate messages-sv2 that is a crate that stay between the low levels crates (subprotocols, codec,
noise, binary, framing) and the high level roles implementation it export an interface that make some very
recurrent operation rather complex to execute. The exported interface should be refactored in order
to make this operations easier. (Performance must have priority on usability btw)
Add support for AES in Noise protocol:
https://github.com/braiins/braiins-open/blob/master/protocols/stratum/src/v2/noise.rs#L220
https://github.com/braiins/braiins-open/blob/master/protocols/stratum/src/v2/noise.rs#L419
https://github.com/stratum-mining/stratum/blob/main/protocols/v2/noise-sv2/src/lib.rs#L116
Sv2 primitive Visitors panics for invalid inputs. We should find a way to never panic and always return errors.
Examples of incorrect visitors are:
Tracking issue (that will be realized in /stratum-mining/bitcoin)
Errors from serde-sv2 and no-serde-sv2 must be refactored. Binary-sv2 should define an Error type that implement from serde-sv2 Error and from no-serde-sv2 Error users should only care about binary-sv2 errors.
Tracking issue
Realization of a proxy that is:
TODO
Tracking issue (that will be realized in /stratum-mining/bitcoin)
Is impossible to derive encodable and decodable for enums. Add this feature.
https://github.com/stratum-mining/stratum/blob/main/protocols/v2/binary-sv2/no-serde-sv2/derive_codec/src/lib.rs
Tracking issue
When implementing Arbitrary
we should also implement shrink
.
Example from @Fi3:
fn shrink(&self) -> Box<dyn Iterator<Item = Self>> {
let value = self.clone().0;
match value.template_id {
0 => empty_shrinker(),
_ => {
let mut shrinked_ids: Vec<NewTemplate> = vec![];
for id in 0..value.template_id {
let mut shrinked_value = value.clone();
shrinked_value.template_id = id;
shrinked_ids.push(shrinked_value);
};
Box::new(shrinked_ids.into_iter().map(|x| RandomNewTemplate(x)))
}
}
}
tracking issue
Realization of a pool that can be used in production environment
In order for Sv2 to succeed, operational cost for a pool to support it must be low, and implementation cost must be near 0.
Tracking issue (that will be realized in /stratum-mining/bitcoin)
Implement a Sv2 Template Provider in Bitcoin Core.
Allows Bitcoin Core to act as a Template Provider to StratumV2 Proxies.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.