Skip to content
Open
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
118 changes: 48 additions & 70 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ members = [
#"cmd/peer-watcher",
"cmd/airdrop",
#"cmd/replay",
"stratum",
"cmd/miner_client/api",
#"cmd/db-exporter",
"cmd/genesis-nft-miner",
Expand Down Expand Up @@ -248,14 +247,15 @@ default-members = [
"cmd/airdrop",
#"cmd/replay",
"cmd/genesis-nft-miner",
"stratum",
"cmd/miner_client/api",
#"cmd/db-exporter",
"cmd/cmd-utils",
"dataformat-generator",
"dataformat-generator-vm2",
]

exclude = ["cmd/stratumd"]

[profile.dev]
panic = "unwind"

Expand Down Expand Up @@ -467,6 +467,7 @@ pin-utils = "0.1.0"
pretty = "0.12.5"
proc-macro2 = "1.0"
prometheus = "0.13.0"
postgres = "0.19.12"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if postgres 0.19.12 exists on crates.io
curl -s "https://crates.io/api/v1/crates/postgres/0.19.12" | python3 -c "
import sys, json
try:
    data = json.load(sys.stdin)
    if 'version' in data:
        print(f'✓ Found: postgres {data[\"version\"][\"num\"]}')
    elif 'errors' in data:
        print(f'✗ Not found: {data[\"errors\"]}')
    else:
        print(json.dumps(data, indent=2))
except json.JSONDecodeError as e:
    print(f'Error parsing response: {e}')
"

Repository: starcoinorg/starcoin

Length of output: 89


🏁 Script executed:

#!/bin/bash
# Check if any workspace member (excluding cmd/stratumd) depends on 'postgres'
echo "=== Checking for postgres references in workspace Cargo.toml files ===" 
rg 'postgres' --glob '*/Cargo.toml' -A 2 -B 2

Repository: starcoinorg/starcoin

Length of output: 134


🏁 Script executed:

#!/bin/bash
# Get context around line 470 in Cargo.toml to see the workspace.dependencies section
echo "=== Context around line 470 (postgres dependency) ===" 
sed -n '465,475p' Cargo.toml

Repository: starcoinorg/starcoin

Length of output: 408


Remove unused postgres workspace dependency or verify its necessity.

The postgres crate version 0.19.12 exists on crates.io, but no active workspace member references it in their dependencies. Since cmd/stratumd is excluded from the workspace, it manages its own dependencies and does not use the workspace-level declaration. Remove this unused entry unless it serves a specific purpose for the workspace.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` at line 470, The workspace-level dependency entry postgres =
"0.19.12" is unused by any active workspace member; either remove that line from
Cargo.toml or, if the cmd/stratumd crate (which is excluded from the workspace)
needs it, move the postgres dependency into that crate's own Cargo.toml; verify
by searching for "postgres" in workspace member Cargo.toml files and ensuring no
member relies on the workspace declaration before deleting it.

proptest = "1.10.0"
proptest-derive = "0.8.0"
quote = "1.0.16"
Expand Down Expand Up @@ -559,7 +560,6 @@ starcoin-state-store-api = { path = "state/state-store-api" }
starcoin-state-tree = { path = "state/state-tree" }
starcoin-statedb = { path = "state/statedb" }
starcoin-storage = { path = "storage" }
starcoin-stratum = { path = "stratum" }
starcoin-sync = { path = "sync" }
starcoin-sync-api = { path = "sync/api" }
starcoin-system = { path = "commons/system", package = "starcoin-system" }
Expand Down
4 changes: 3 additions & 1 deletion cmd/miner_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ starcoin-miner-client-api = { workspace = true }
starcoin-rpc-api = { workspace = true }
starcoin-rpc-client = { workspace = true }
starcoin-service-registry = { workspace = true }
starcoin-stratum = { workspace = true }
stest = { workspace = true }
thiserror = { workspace = true }

[dev-dependencies]
jsonrpc-core = { workspace = true }
jsonrpc-ws-server = { workspace = true }
starcoin-miner = { workspace = true }
once_cell = { workspace = true }

[package]
authors = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions cmd/miner_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pub mod miner;
mod solver;
pub mod stratum_client;
pub mod stratum_client_service;
pub mod stratum_compat;
use anyhow::Result;
use futures::stream::BoxStream;
use starcoin_config::TimeService;
Expand Down
2 changes: 1 addition & 1 deletion cmd/miner_client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use starcoin_miner_client::stratum_client::StratumJobClient;
use starcoin_miner_client::stratum_client_service::{
StratumClientService, StratumClientServiceServiceFactory,
};
use starcoin_miner_client::stratum_compat::LoginRequest;
use starcoin_service_registry::{RegistryAsyncService, RegistryService};
use starcoin_stratum::rpc::LoginRequest;
use starcoin_time_service::RealTimeService;
use std::sync::Arc;

Expand Down
9 changes: 5 additions & 4 deletions cmd/miner_client/src/stratum_client.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
use crate::stratum_client_service::{ShareRequest, StratumClientService, SubmitSealRequest};
use crate::stratum_client_service::{
LoginServiceRequest, ShareRequest, StratumClientService, SubmitSealRequest,
};
use crate::stratum_compat::{target_hex_to_difficulty, LoginRequest};
use crate::{ConsensusStrategy, JobClient, SealEvent};
use anyhow::Result;
use byteorder::{LittleEndian, WriteBytesExt};
use futures::future;
use futures::stream::{BoxStream, StreamExt};
use starcoin_logger::prelude::error;
use starcoin_service_registry::ServiceRef;
use starcoin_stratum::rpc::LoginRequest;
use starcoin_stratum::target_hex_to_difficulty;
use starcoin_time_service::TimeService;
use starcoin_types::system_events::{MintBlockEvent, MintEventExtra};
use std::sync::Arc;
Expand Down Expand Up @@ -39,7 +40,7 @@ impl JobClient for StratumJobClient {
let login = self.login.clone();
let fut = async move {
let stream = srv
.send(login)
.send(LoginServiceRequest(login))
.await?
.await
.map_err(|e| anyhow::anyhow!(format!("{}", e)))
Expand Down
Loading
Loading