Skip to content

Commit

Permalink
chore: fix ci (#6391)
Browse files Browse the repository at this point in the history
Description
---

Motivation and Context
---

How Has This Been Tested?
---

What process can a PR reviewer use to test or verify this change?
---

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
SWvheerden authored Jul 9, 2024
1 parent cb1eb63 commit 0156fc5
Show file tree
Hide file tree
Showing 79 changed files with 194 additions and 335 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_binaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"name": "linux-x86_64",
"runs-on": "ubuntu-20.04",
"rust": "nightly-2024-03-01",
"rust": "nightly-2024-07-07",
"target": "x86_64-unknown-linux-gnu",
"cross": false,
"build_metric": true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ env:
TS_FEATURES: "default, safe"
TS_LIBRARIES: "minotari_mining_helper_ffi"
TARI_NETWORK_DIR: testnet
toolchain: nightly-2024-03-01
toolchain: nightly-2024-07-07
matrix-json-file: ".github/workflows/build_binaries.json"
CARGO_HTTP_MULTIPLEXING: false
CARGO_UNSTABLE_SPARSE_REGISTRY: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_dockers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ name: Build docker images
- xmrig

env:
toolchain_default: nightly-2024-03-01
toolchain_default: nightly-2024-07-07

concurrency:
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_dockers_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: Build docker images - workflow_call/on-demand
toolchain:
type: string
description: 'Rust toolchain'
default: nightly-2024-03-01
default: nightly-2024-07-07
arch:
type: string
default: x86-64
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: CI
merge_group:

env:
toolchain: nightly-2024-03-01
toolchain: nightly-2024-07-07
CARGO_HTTP_MULTIPLEXING: false
CARGO_TERM_COLOR: always
CARGO_UNSTABLE_SPARSE_REGISTRY: true
Expand All @@ -32,7 +32,7 @@ concurrency:
jobs:
clippy:
name: clippy
runs-on: [ubuntu-20.04]
runs-on: [ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
machete:
# Checks for unused dependencies.
name: machete
runs-on: [ubuntu-20.04]
runs-on: [ubuntu-latest]
steps:
- name: checkout
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Source Coverage
- ci-coverage-*

env:
toolchain: nightly-2024-03-01
toolchain: nightly-2024-07-07

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ name: Integration tests
type: string

env:
toolchain: nightly-2024-03-01
toolchain: nightly-2024-07-07

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
16 changes: 12 additions & 4 deletions Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const REQUIRED_IDENTITY_PERMS: u32 = 0o100600;
/// - `identity_file` - Reference to file path
/// - `public_address` - Network address of the base node
/// - `create_id` - Only applies if the identity_file does not exist or is malformed. If true, a new identity will be
/// created, otherwise the user will be prompted to create a new ID
/// created, otherwise the user will be prompted to create a new ID
/// - `peer_features` - Enables features of the base node
///
/// # Return
Expand Down
2 changes: 1 addition & 1 deletion applications/minotari_console_wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ futures = { version = "^0.3.16", default-features = false, features = [
] }
ledger-transport-hid = { git = "https://github.com/Zondax/ledger-rs", rev = "20e2a20", optional = true }
log = { version = "0.4.8", features = ["std"] }
log4rs = { version = "1.3.0", default_features = false, features = [
log4rs = { version = "1.3.0", default-features = false, features = [
"config_parsing",
"threshold_filter",
"yaml_format",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ pub async fn make_it_rain(
// - If a slower rate is requested as what is achievable, transactions will be delayed to match the rate.
// - If a faster rate is requested as what is achievable, the maximum rate will be that of the integrated system.
// - The default value of 25/s may not be achievable.
let transactions_per_second = transactions_per_second.abs().max(0.01).min(250.0);
let transactions_per_second = transactions_per_second.abs().clamp(0.01, 250.0);
// We are spawning this command in parallel, thus not collecting transaction IDs
tokio::task::spawn(async move {
// Wait until specified test start time
Expand Down
1 change: 1 addition & 0 deletions applications/minotari_console_wallet/src/notifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ pub const CANCELLED: &str = "cancelled";

#[derive(Clone)]
// FIXME
#[allow(dead_code)]
#[allow(clippy::large_enum_variant)]
pub enum WalletEventMessage {
Completed {
Expand Down
1 change: 1 addition & 0 deletions applications/minotari_console_wallet/src/ui/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ use crate::{
pub const LOG_TARGET: &str = "wallet::ui::app";

pub struct App<B: Backend> {
#[allow(dead_code)]
pub title: String,
pub should_quit: bool,
// Cached state this will need to be cleaned up into a threadsafe container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ pub struct BlockTemplateData {
pub monero_difficulty: u64,
pub tari_difficulty: u64,
pub tari_merge_mining_hash: FixedHash,
#[allow(dead_code)]
pub aux_chain_hashes: Vec<monero::Hash>,
pub new_block_template: grpc::NewBlockTemplate,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl BlockTemplateProtocol<'_> {
let grpc::NewBlockTemplateResponse {
miner_data,
new_block_template: template,
initial_sync_achieved,
initial_sync_achieved: _,
} = self
.base_node_client
.get_new_block_template(grpc::NewBlockTemplateRequest {
Expand All @@ -289,11 +289,7 @@ impl BlockTemplateProtocol<'_> {

let miner_data = miner_data.ok_or(MmProxyError::GrpcResponseMissingField("miner_data"))?;
let template = template.ok_or(MmProxyError::GrpcResponseMissingField("new_block_template"))?;
Ok(NewBlockTemplateData {
template,
miner_data,
initial_sync_achieved,
})
Ok(NewBlockTemplateData { template, miner_data })
}

/// Check if the height is more than the actual tip. So if still makes sense to compute block for that height.
Expand Down Expand Up @@ -439,7 +435,6 @@ fn add_monero_data(
pub struct NewBlockTemplateData {
pub template: grpc::NewBlockTemplate,
pub miner_data: grpc::MinerData,
pub initial_sync_achieved: bool,
}

impl NewBlockTemplateData {
Expand Down
3 changes: 3 additions & 0 deletions applications/minotari_merge_mining_proxy/src/monero_fail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,13 @@ pub struct MonerodEntry {
/// Whether the server is currently up
pub up: bool,
/// Whether the server is web compatible
#[allow(dead_code)]
pub web_compatible: bool,
/// The network the server is on (mainnet, stagenet, testnet)
#[allow(dead_code)]
pub network: String,
/// Time since the server was checked
#[allow(dead_code)]
pub last_checked: String,
/// The history of the server being up
pub up_history: Vec<bool>,
Expand Down
11 changes: 6 additions & 5 deletions applications/minotari_merge_mining_proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,12 @@ impl InnerService {
};

// Query the list twice before giving up, starting after the last used entry
let pos = if let Some(index) = self.config.monerod_url.iter().position(|x| x == &last_used_url) {
index
} else {
0
};
let pos = self
.config
.monerod_url
.iter()
.position(|x| x == &last_used_url)
.unwrap_or(0);
let (left, right) = self.config.monerod_url.split_at(pos);
let left = left.to_vec();
let right = right.to_vec();
Expand Down
6 changes: 3 additions & 3 deletions applications/minotari_miner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ derivative = "2.2.0"
futures = "0.3"
hex = "0.4.2"
log = { version = "0.4", features = ["std"] }
log4rs = { version = "1.3.0", default_features = false, features = ["config_parsing", "threshold_filter", "yaml_format", "console_appender", "rolling_file_appender", "compound_policy", "size_trigger", "fixed_window_roller"] }
log4rs = { version = "1.3.0", default-features = false, features = ["config_parsing", "threshold_filter", "yaml_format", "console_appender", "rolling_file_appender", "compound_policy", "size_trigger", "fixed_window_roller"] }
native-tls = "0.2"
num_cpus = "1.13"
rand = "0.8"
serde = { version = "1.0", default_features = false, features = ["derive"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_json = "1.0.57"
thiserror = "1.0"
tokio = { version = "1.36", default_features = false, features = ["rt-multi-thread"] }
tokio = { version = "1.36", default-features = false, features = ["rt-multi-thread"] }
tonic = { version = "0.8.3", features = ["tls", "tls-roots"] }

[dev-dependencies]
Expand Down
9 changes: 3 additions & 6 deletions applications/minotari_miner/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,11 @@
// configuration management
//! from [tari_common] crate, also extending with few
//! specific options:
//! - base_node_grpc_address - is IPv4/IPv6 address including port
//! number, by which Minotari Base Node can be found
//! - base_node_grpc_address - is IPv4/IPv6 address including port number, by which Minotari Base Node can be found
//! - num_mining_threads - number of mining threads, defaults to number of cpu cores
//! - mine_on_tip_only - will start mining only when node is reporting bootstrapped state
//! - validate_tip_timeout_sec - will check tip with node every N seconds to validate that still
//! mining on a tip
//! All miner options configured under `[miner]` section of
//! Minotari's `config.toml`.
//! - validate_tip_timeout_sec - will check tip with node every N seconds to validate that still mining on a tip All
//! miner options configured under `[miner]` section of Minotari's `config.toml`.
use std::{
path::{Path, PathBuf},
Expand Down
3 changes: 0 additions & 3 deletions applications/minotari_miner/src/miner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ pub struct MiningReport {
/// Will be set for when mined header is matching required difficulty
pub header: Option<BlockHeader>,
pub height: u64,
pub last_nonce: u64,
}

/// Miner is starting number of mining threads and implements Stream for async reports polling
Expand Down Expand Up @@ -212,7 +211,6 @@ pub fn mining_task(
hashes: hasher.hashes,
elapsed: start.elapsed(),
height: hasher.height(),
last_nonce: hasher.header.nonce,
header: Some(hasher.create_header()),
target_difficulty,
}) {
Expand All @@ -235,7 +233,6 @@ pub fn mining_task(
hashes: hasher.hashes,
elapsed: start.elapsed(),
header: None,
last_nonce: hasher.header.nonce,
height: hasher.height(),
target_difficulty,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use serde::{Deserialize, Serialize};
pub struct LoginParams {
pub login: String,
#[derivative(Debug = "ignore")]
#[allow(dead_code)]
#[serde(skip_serializing)]
pub pass: String,
pub agent: String,
Expand Down
2 changes: 1 addition & 1 deletion applications/minotari_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ futures = { version = "^0.3.16", default-features = false, features = ["alloc"]
qrcode = { version = "0.12" }
log = { version = "0.4.8", features = ["std"] }
log-mdc = "0.1.0"
log4rs = { version = "1.3.0", default_features = false, features = ["config_parsing", "threshold_filter", "yaml_format", "console_appender", "rolling_file_appender", "compound_policy", "size_trigger", "fixed_window_roller"] }
log4rs = { version = "1.3.0", default-features = false, features = ["config_parsing", "threshold_filter", "yaml_format", "console_appender", "rolling_file_appender", "compound_policy", "size_trigger", "fixed_window_roller"] }
nom = "7.1"
rustyline = "9.0"
rustyline-derive = "0.5"
Expand Down
8 changes: 1 addition & 7 deletions applications/minotari_node/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,7 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::{
cmp,
str::FromStr,
sync::{Arc, RwLock},
};
use std::{cmp, str::FromStr, sync::Arc};

use log::*;
use minotari_app_utilities::{consts, identity_management, identity_management::load_from_json};
Expand Down Expand Up @@ -56,7 +52,6 @@ use tari_core::{
mempool::{service::MempoolHandle, Mempool, MempoolServiceInitializer, MempoolSyncInitializer},
proof_of_work::randomx_factory::RandomXFactory,
transactions::CryptoFactories,
OutputSmt,
};
use tari_p2p::{
auto_update::SoftwareUpdaterService,
Expand Down Expand Up @@ -86,7 +81,6 @@ pub struct BaseNodeBootstrapper<'a, B> {
pub factories: CryptoFactories,
pub randomx_factory: RandomXFactory,
pub interrupt_signal: ShutdownSignal,
pub smt: Arc<RwLock<OutputSmt>>,
}

impl<B> BaseNodeBootstrapper<'_, B>
Expand Down
1 change: 0 additions & 1 deletion applications/minotari_node/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ async fn build_node_context(
factories: factories.clone(),
randomx_factory,
interrupt_signal: interrupt_signal.clone(),
smt,
}
.bootstrap()
.await?;
Expand Down
4 changes: 0 additions & 4 deletions applications/minotari_node/src/commands/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ use thiserror::Error;

use super::command::Command;

#[derive(Debug, Error)]
#[error("invalid format '{0}'")]
pub struct FormatParseError(String);

#[derive(Debug, Display, EnumString)]
#[strum(serialize_all = "kebab-case")]
pub enum Format {
Expand Down
1 change: 1 addition & 0 deletions base_layer/chat_ffi/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pub enum InterfaceError {
#[derive(Debug, Clone)]
pub struct LibChatError {
pub code: i32,
#[allow(dead_code)]
pub message: String,
}

Expand Down
3 changes: 1 addition & 2 deletions base_layer/contacts/src/contacts_service/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,8 @@ where T: ContactsBackend + 'static
error!(target: LOG_TARGET, "Error handling request: {:?}", e);
e
});
let _result = reply_tx.send(response).map_err(|e| {
let _result = reply_tx.send(response).inspect_err(|_| {
error!(target: LOG_TARGET, "Failed to send reply");
e
});
},

Expand Down
3 changes: 3 additions & 0 deletions base_layer/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ tari_features = { path = "../../common/tari_features", version = "1.0.0-pre.15"
[[bench]]
name = "mempool"
harness = false

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tari_target_network_mainnet)', 'cfg(tari_target_network_nextnet)', 'cfg(tari_target_network_testnet)'] }
2 changes: 1 addition & 1 deletion base_layer/core/src/chain_storage/lmdb_db/lmdb_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1445,7 +1445,7 @@ impl LMDBDatabase {
seed: &[u8],
height: u64,
) -> Result<(), ChainStorageError> {
let current_height = lmdb_get(write_txn, &self.monero_seed_height_db, seed)?.unwrap_or(std::u64::MAX);
let current_height = lmdb_get(write_txn, &self.monero_seed_height_db, seed)?.unwrap_or(u64::MAX);
if height < current_height {
lmdb_replace(write_txn, &self.monero_seed_height_db, seed, &height, None)?;
};
Expand Down
Loading

0 comments on commit 0156fc5

Please sign in to comment.