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

Release 2.0.1 #4162

Merged
merged 4 commits into from
Jul 23, 2024
Merged
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
221 changes: 111 additions & 110 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion abi/decoder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "starcoin-abi-decoder"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
publish = { workspace = true }
repository = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion abi/resolver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ test-helper = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
name = "starcoin-abi-resolver"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion abi/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "starcoin-abi-types"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
publish = { workspace = true }
repository = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion account/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-account"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion account/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-account-api"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion account/provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ starcoin-types = { workspace = true }
[package]
edition = { workspace = true }
name = "starcoin-account-provider"
version = "2.0.0"
version = "2.0.1"
authors = { workspace = true }
homepage = { workspace = true }
license = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion account/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-account-service"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "benchmarks"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion block-relayer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-block-relayer"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-chain"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion chain/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-chain-api"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion chain/chain-notify/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-chain-notify"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion chain/mock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-chain-mock"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion chain/open-block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-open-block"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion chain/service/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-chain-service"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/airdrop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ tokio = { features = ["full"], workspace = true }
authors = { workspace = true }
edition = { workspace = true }
name = "airdrop"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/db-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "db-exporter"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/faucet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-faucet"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-generator"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/genesis-nft-miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "genesis-nft-miner"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/indexer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-indexer"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/merkle-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ starcoin-vm-types = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
name = "merkle-generator"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ starcoin-miner = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
name = "starcoin-miner-client"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ starcoin-types = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
name = "starcoin-miner-client-api"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
license = { workspace = true }
publish = { workspace = true }
Expand Down
6 changes: 5 additions & 1 deletion cmd/miner_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use starcoin_miner_client::stratum_client::StratumJobClient;
use starcoin_miner_client::stratum_client_service::{
StratumClientService, StratumClientServiceServiceFactory,
};
use starcoin_miner_client::ConsensusStrategy;
use starcoin_service_registry::{RegistryAsyncService, RegistryService};
use starcoin_stratum::rpc::LoginRequest;
use starcoin_time_service::RealTimeService;
Expand All @@ -25,11 +26,14 @@ pub struct StarcoinOpt {
pub thread_num: u16,
#[clap(long, short = 'p')]
pub plugin_path: Option<String>,
#[clap(long, short = 'g', default_value_t = ConsensusStrategy::Argon)]
pub algo: ConsensusStrategy,
}

fn main() {
let _logger_handle = starcoin_logger::init();
let opts: StarcoinOpt = StarcoinOpt::parse();
let algo = opts.algo;
let config = {
MinerClientConfig {
server: Some(opts.server.clone()),
Expand Down Expand Up @@ -61,7 +65,7 @@ fn main() {
algo: None,
};

let stratum_job_client = StratumJobClient::new(stratum_cli_srv, time_srv, login);
let stratum_job_client = StratumJobClient::new(stratum_cli_srv, time_srv, login, algo);
registry.put_shared(stratum_job_client).await?;
registry
.register::<MinerClientService<StratumJobClient>>()
Expand Down
10 changes: 7 additions & 3 deletions cmd/miner_client/src/stratum_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,21 @@ pub struct StratumJobClient {
stratum_cli_srv: ServiceRef<StratumClientService>,
time_service: Arc<dyn TimeService>,
login: LoginRequest,
strategy: ConsensusStrategy,
}

impl StratumJobClient {
pub fn new(
stratum_cli_srv: ServiceRef<StratumClientService>,
time_service: Arc<dyn TimeService>,
login: LoginRequest,
strategy: ConsensusStrategy,
) -> Self {
Self {
stratum_cli_srv,
time_service,
login,
strategy,
}
}
}
Expand All @@ -40,21 +43,22 @@ impl JobClient for StratumJobClient {
async fn subscribe(&self) -> Result<BoxStream<'static, MintBlockEvent>> {
let srv = self.stratum_cli_srv.clone();
let login = self.login.clone();
let strategy = self.strategy;
let fut = async move {
let stream = srv
.send(login)
.await?
.await
.map_err(|e| anyhow::anyhow!(format!("{}", e)))
.map(|s| {
s.filter_map(|job| {
.map(move |s| {
s.filter_map(move |job| {
let blob = hex::decode(&job.blob);
let diff = target_hex_to_difficulty(&job.target);
let extra = job.get_extra();
let event = if let (Ok(blob), Ok(diff), Ok(extra)) = (blob, diff, extra) {
Some(MintBlockEvent {
parent_hash: Default::default(),
strategy: ConsensusStrategy::CryptoNight,
strategy,
minting_blob: blob,
difficulty: diff,
block_number: job.height,
Expand Down
2 changes: 1 addition & 1 deletion cmd/peer-watcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-peer-watcher"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/replay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-replay"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/resource-exporter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "resource-exporter"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cmd/starcoin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-cmd"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion cmd/tx-factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-tx-factory"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion commons/accumulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "starcoin-accumulator"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion commons/api-limiter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "api-limiter"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
publish = { workspace = true }
repository = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion commons/bcs_ext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "bcs-ext"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion commons/decrypt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
name = "starcoin-decrypt"
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
publish = { workspace = true }
repository = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion commons/forkable-jellyfish-merkle/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ edition = { workspace = true }
license = { workspace = true }
name = "forkable-jellyfish-merkle"
publish = { workspace = true }
version = "2.0.0"
version = "2.0.1"
homepage = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
2 changes: 1 addition & 1 deletion commons/infallible/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "starcoin-infallible"
version = "2.0.0"
version = "2.0.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
Loading
Loading