mirror of
https://github.com/logos-co/nomos-node.git
synced 2026-08-27 09:31:10 +00:00
chore: update toolchain to 1.86.0 (#1213)
* Updates * Remove unused deps * Fix broken step to create a new GH issue
This commit is contained in:
@@ -33,7 +33,7 @@ jobs:
|
||||
uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746 # Version 1.0.6
|
||||
with:
|
||||
# The same version must be used in the `.pre-commit-config.yaml` file
|
||||
toolchain: nightly-2025-01-03
|
||||
toolchain: nightly-2025-02-16
|
||||
profile: minimal
|
||||
components: rustfmt
|
||||
override: true
|
||||
|
||||
@@ -44,7 +44,7 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # Version 4.2.2
|
||||
- name: Create a GH issue (if it does not exist)
|
||||
uses: JasonEtco/create-an-issue@56fdd2d6f960e970fa9d5ca3cf3884b6ba5af477 # Version 2.9.2
|
||||
uses: JasonEtco/create-an-issue@1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 # Version 2.9.2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RUST_VERSION: ${{ needs.check-latest-version.outputs.new-version }}
|
||||
|
||||
@@ -3,7 +3,7 @@ repos:
|
||||
rev: v1.0
|
||||
hooks:
|
||||
- id: fmt
|
||||
entry: cargo +nightly-2025-01-03 fmt
|
||||
entry: cargo +nightly-2025-02-16 fmt
|
||||
- id: clippy
|
||||
- repo: https://github.com/EmbarkStudios/cargo-deny
|
||||
rev: 0.18.0
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
# BUILD IMAGE
|
||||
# ===========================
|
||||
|
||||
FROM rust:1.85.1-slim-bookworm AS builder
|
||||
FROM rust:1.86.0-slim-bookworm AS builder
|
||||
|
||||
LABEL maintainer="augustinas@status.im" \
|
||||
source="https://github.com/logos-co/nomos-node" \
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
FROM rust:1.85.1-slim-bookworm
|
||||
FROM rust:1.86.0-slim-bookworm
|
||||
|
||||
LABEL maintainer="augustinas@status.im" \
|
||||
source="https://github.com/logos-co/nomos-node" \
|
||||
|
||||
@@ -162,8 +162,8 @@ impl CommonHttpClient {
|
||||
let status = response.status();
|
||||
|
||||
let shares_stream = response.bytes_stream().filter_map(|item| async move {
|
||||
item.ok()
|
||||
.and_then(|bytes| serde_json::from_slice::<B::LightShare>(&bytes).ok())
|
||||
let bytes = item.ok()?;
|
||||
serde_json::from_slice::<B::LightShare>(&bytes).ok()
|
||||
});
|
||||
match status {
|
||||
StatusCode::OK => Ok(shares_stream),
|
||||
|
||||
@@ -229,15 +229,14 @@ where
|
||||
|
||||
pub fn get_security_block_header_id(&self) -> Option<Id> {
|
||||
(0..self.config.security_param.get()).try_fold(self.tip(), |header, _| {
|
||||
self.branches.get(&header).and_then(|branch| {
|
||||
let parent = branch.parent;
|
||||
if header == parent {
|
||||
// If the header is the genesis block, we arrived at the end of the chain
|
||||
None
|
||||
} else {
|
||||
Some(parent)
|
||||
}
|
||||
})
|
||||
let branch = self.branches.get(&header)?;
|
||||
let parent = branch.parent;
|
||||
if header == parent {
|
||||
// If the header is the genesis block, we arrived at the end of the chain
|
||||
None
|
||||
} else {
|
||||
Some(parent)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -911,6 +911,6 @@ pub mod tests {
|
||||
Some(LedgerError::InvalidSlot { parent, block })
|
||||
if parent == slot && block == slot2 => {}
|
||||
_ => panic!("error does not match the LedgerError::InvalidSlot pattern"),
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,7 @@ pub fn update_tracing(
|
||||
LoggerLayerType::Stdout => LoggerLayer::Stdout,
|
||||
LoggerLayerType::Stderr => LoggerLayer::Stderr,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if let Some(level_str) = level {
|
||||
tracing.level = match level_str.as_str() {
|
||||
|
||||
@@ -106,7 +106,7 @@ impl ConnectionMonitor {
|
||||
}
|
||||
}
|
||||
|
||||
fn reset(&mut self) {
|
||||
const fn reset(&mut self) {
|
||||
self.effective_messages = U57F7::ZERO;
|
||||
self.drop_messages = U57F7::ZERO;
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ where
|
||||
if let Some(msg) = self.queue.pop_front() {
|
||||
return Poll::Ready(Some(msg));
|
||||
}
|
||||
};
|
||||
}
|
||||
Poll::Pending
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ impl BlendMessage for MockBlendMessage {
|
||||
// Append payload with padding
|
||||
message.extend(payload);
|
||||
message.push(PAYLOAD_PADDING_SEPARATOR);
|
||||
message.extend(std::iter::repeat(0).take(MAX_PAYLOAD_SIZE - payload.len()));
|
||||
message.extend(std::iter::repeat_n(0, MAX_PAYLOAD_SIZE - payload.len()));
|
||||
Ok(message)
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ impl<D: ConsistentLengthLayeredCipherData> ConsistentLengthLayeredCipher<D> {
|
||||
let total_data_with_zero_filler = encrypted_total_data
|
||||
.iter()
|
||||
.copied()
|
||||
.chain(std::iter::repeat(0u8).take(Self::SINGLE_LAYER_SIZE))
|
||||
.chain(std::iter::repeat_n(0u8, Self::SINGLE_LAYER_SIZE))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Decrypt the extended data.
|
||||
|
||||
@@ -218,7 +218,7 @@ where
|
||||
if remaining_established == 0 {
|
||||
self.negotiated_peers.remove(&peer_id);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
self.try_wake();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ mod test {
|
||||
if let SwarmEvent::Behaviour(Event::Message(received_msg)) = event {
|
||||
assert_eq!(received_msg, msg);
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
// Proceed swarm2
|
||||
_ = swarm2.select_next_some() => {}
|
||||
|
||||
@@ -20,7 +20,6 @@ indexmap = { version = "1.9", features = ["serde"] }
|
||||
nomos-ledger = { workspace = true, features = ["serde"] }
|
||||
nomos_proof_statements = { workspace = true }
|
||||
nomos_risc0_proofs = { path = "../risc0_proofs" }
|
||||
once_cell = "1.0"
|
||||
risc0-zkvm = { workspace = true }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
thiserror = "1.0"
|
||||
|
||||
@@ -69,6 +69,10 @@ impl Header {
|
||||
self.slot
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::missing_const_for_fn,
|
||||
reason = "Using `Deref` which is not const."
|
||||
)]
|
||||
#[must_use]
|
||||
pub fn orphaned_proofs(&self) -> &[Self] {
|
||||
&self.orphaned_leader_proofs
|
||||
|
||||
@@ -25,6 +25,10 @@ impl Bundle {
|
||||
&self.bundle
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::missing_const_for_fn,
|
||||
reason = "Using `Deref` which is not const."
|
||||
)]
|
||||
#[must_use]
|
||||
pub fn cm_roots(&self) -> &[[u8; 32]] {
|
||||
&self.cm_roots
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use bincode::{
|
||||
config::{
|
||||
Bounded, FixintEncoding, LittleEndian, RejectTrailing, WithOtherEndian,
|
||||
@@ -6,7 +8,6 @@ use bincode::{
|
||||
de::read::SliceReader,
|
||||
Error, ErrorKind, Options,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
// Type composition is cool but also makes naming types a bit awkward
|
||||
pub type BincodeOptions = WithOtherTrailing<
|
||||
@@ -21,7 +22,7 @@ pub type BincodeOptions = WithOtherTrailing<
|
||||
// Risc0 proofs are HUGE (220 Kb) and it's the only reason we need to have this
|
||||
// limit so large
|
||||
pub const DATA_LIMIT: u64 = 1 << 18; // Do not serialize/deserialize more than 256 KiB
|
||||
pub static OPTIONS: Lazy<BincodeOptions> = Lazy::new(|| {
|
||||
pub static OPTIONS: LazyLock<BincodeOptions> = LazyLock::new(|| {
|
||||
bincode::DefaultOptions::new()
|
||||
.with_little_endian()
|
||||
.with_limit(DATA_LIMIT)
|
||||
|
||||
@@ -15,6 +15,10 @@ impl Bundle {
|
||||
Self { partials }
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::missing_const_for_fn,
|
||||
reason = "Using `Deref` which is not const."
|
||||
)]
|
||||
#[must_use]
|
||||
pub fn partial_txs(&self) -> &[PartialTx] {
|
||||
&self.partials
|
||||
@@ -42,6 +46,10 @@ impl BundleWitness {
|
||||
)
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::missing_const_for_fn,
|
||||
reason = "Using `Deref` which is not const."
|
||||
)]
|
||||
#[must_use]
|
||||
pub fn partial_witnesses(&self) -> &[PartialTxWitness] {
|
||||
&self.partials
|
||||
|
||||
@@ -14,7 +14,6 @@ blake2 = "0.10"
|
||||
itertools = "0.12"
|
||||
kzgrs = { workspace = true }
|
||||
nomos-core = { workspace = true }
|
||||
once_cell = "1.19"
|
||||
rand = "0.8.5"
|
||||
rayon = { version = "1.10.0", optional = true }
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
||||
@@ -344,7 +344,7 @@ impl nomos_core::da::DaEncoder for DaEncoder {
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test {
|
||||
use std::ops::Div;
|
||||
use std::{ops::Div, sync::LazyLock};
|
||||
|
||||
use ark_ff::PrimeField;
|
||||
use ark_poly::{EvaluationDomain, GeneralEvaluationDomain};
|
||||
@@ -354,7 +354,6 @@ pub mod test {
|
||||
PolynomialEvaluationDomain, BYTES_PER_FIELD_ELEMENT,
|
||||
};
|
||||
use nomos_core::da::DaEncoder as _;
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::RngCore;
|
||||
|
||||
use crate::{
|
||||
@@ -363,9 +362,9 @@ pub mod test {
|
||||
};
|
||||
|
||||
pub static DOMAIN_SIZE: usize = 16;
|
||||
pub static PARAMS: Lazy<DaEncoderParams> =
|
||||
Lazy::new(|| DaEncoderParams::default_with(DOMAIN_SIZE));
|
||||
pub static ENCODER: Lazy<DaEncoder> = Lazy::new(|| DaEncoder::new(PARAMS.clone()));
|
||||
pub static PARAMS: LazyLock<DaEncoderParams> =
|
||||
LazyLock::new(|| DaEncoderParams::default_with(DOMAIN_SIZE));
|
||||
pub static ENCODER: LazyLock<DaEncoder> = LazyLock::new(|| DaEncoder::new(PARAMS.clone()));
|
||||
|
||||
#[must_use]
|
||||
pub fn rand_data(elements_count: usize) -> Vec<u8> {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
use std::sync::LazyLock;
|
||||
|
||||
// Reexport global parameters loading from file.
|
||||
pub use kzgrs::global_parameters_from_file;
|
||||
use kzgrs::{global_parameters_from_randomness, GlobalParameters};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
pub static GLOBAL_PARAMETERS: Lazy<GlobalParameters> = Lazy::new(|| {
|
||||
pub static GLOBAL_PARAMETERS: LazyLock<GlobalParameters> = LazyLock::new(|| {
|
||||
println!("WARNING: Global parameters are randomly generated. Use for development only.");
|
||||
let mut rng = rand::thread_rng();
|
||||
global_parameters_from_randomness(&mut rng)
|
||||
|
||||
@@ -151,6 +151,8 @@ impl DaVerifier {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use ark_bls12_381::Fr;
|
||||
use ark_poly::{EvaluationDomain, GeneralEvaluationDomain};
|
||||
use kzgrs::{
|
||||
@@ -159,7 +161,6 @@ mod test {
|
||||
PolynomialEvaluationDomain, Proof, BYTES_PER_FIELD_ELEMENT,
|
||||
};
|
||||
use nomos_core::da::{blob::Share, DaEncoder};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use crate::{
|
||||
common::{hash_commitment, share::DaShare, Chunk, Column},
|
||||
@@ -182,7 +183,7 @@ mod test {
|
||||
fn prepare_column(
|
||||
with_new_global_params: bool,
|
||||
) -> Result<ColumnVerifyData, Box<dyn std::error::Error>> {
|
||||
pub static NEW_GLOBAL_PARAMETERS: Lazy<GlobalParameters> = Lazy::new(|| {
|
||||
pub static NEW_GLOBAL_PARAMETERS: LazyLock<GlobalParameters> = LazyLock::new(|| {
|
||||
let mut rng = rand::thread_rng();
|
||||
global_parameters_from_randomness(&mut rng)
|
||||
});
|
||||
|
||||
@@ -16,7 +16,6 @@ ark-serialize = { version = "0.4" }
|
||||
blst = "0.3.11"
|
||||
num-bigint = "0.4.4"
|
||||
num-traits = "0.2.18"
|
||||
once_cell = "1.19"
|
||||
rand = "0.8.5"
|
||||
rayon = { version = "1.10", optional = true }
|
||||
thiserror = "1.0.58"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use std::hint::black_box;
|
||||
use std::{hint::black_box, sync::LazyLock};
|
||||
|
||||
use ark_bls12_381::{Bls12_381, Fr};
|
||||
use ark_poly::{univariate::DensePolynomial, EvaluationDomain, GeneralEvaluationDomain};
|
||||
@@ -9,7 +9,6 @@ use kzgrs::{
|
||||
fk20::{fk20_batch_generate_elements_proofs, Toeplitz1Cache},
|
||||
GlobalParameters, BYTES_PER_FIELD_ELEMENT,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::SeedableRng;
|
||||
#[cfg(feature = "parallel")]
|
||||
use rayon::iter::{IntoParallelIterator, ParallelIterator};
|
||||
@@ -18,7 +17,7 @@ fn main() {
|
||||
divan::main();
|
||||
}
|
||||
|
||||
static GLOBAL_PARAMETERS: Lazy<GlobalParameters> = Lazy::new(|| {
|
||||
static GLOBAL_PARAMETERS: LazyLock<GlobalParameters> = LazyLock::new(|| {
|
||||
let mut rng = rand::rngs::StdRng::seed_from_u64(1987);
|
||||
KZG10::<Bls12_381, DensePolynomial<Fr>>::setup(4096, true, &mut rng).unwrap()
|
||||
});
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use ark_bls12_381::{Bls12_381, Fr};
|
||||
use ark_poly::{univariate::DensePolynomial, EvaluationDomain, GeneralEvaluationDomain};
|
||||
use ark_poly_commit::kzg10::{UniversalParams, KZG10};
|
||||
@@ -6,7 +8,6 @@ use kzgrs::{
|
||||
common::bytes_to_polynomial_unchecked,
|
||||
kzg::{commit_polynomial, generate_element_proof, verify_element_proof},
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::RngCore;
|
||||
#[cfg(feature = "parallel")]
|
||||
use rayon::iter::IntoParallelIterator;
|
||||
@@ -22,7 +23,7 @@ fn main() {
|
||||
// #[global_allocator]
|
||||
// static ALLOC: AllocProfiler = AllocProfiler::system();
|
||||
|
||||
static GLOBAL_PARAMETERS: Lazy<UniversalParams<Bls12_381>> = Lazy::new(|| {
|
||||
static GLOBAL_PARAMETERS: LazyLock<UniversalParams<Bls12_381>> = LazyLock::new(|| {
|
||||
let mut rng = rand::thread_rng();
|
||||
KZG10::<Bls12_381, DensePolynomial<Fr>>::setup(4096, true, &mut rng).unwrap()
|
||||
});
|
||||
|
||||
@@ -43,8 +43,7 @@ fn rs_decode(bencher: Bencher, size: usize) {
|
||||
.bench_values(|buff| {
|
||||
black_box(move || {
|
||||
let domain = GeneralEvaluationDomain::<Fr>::new(size).unwrap();
|
||||
let missing_data: Vec<_> = std::iter::repeat(None)
|
||||
.take(size)
|
||||
let missing_data: Vec<_> = std::iter::repeat_n(None, size)
|
||||
.chain(buff.evals[size..].iter().copied().map(Some))
|
||||
.collect();
|
||||
decode(size, &missing_data, domain)
|
||||
|
||||
@@ -138,11 +138,12 @@ pub fn compute_roots_of_unity(size: usize) -> Vec<Fr> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use ark_bls12_381::fr::Fr;
|
||||
use ark_ff::{BigInteger, PrimeField};
|
||||
use ark_poly::{EvaluationDomain, GeneralEvaluationDomain, Polynomial};
|
||||
use blst::BLST_ERROR;
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{thread_rng, Fill};
|
||||
|
||||
use super::{
|
||||
@@ -150,8 +151,8 @@ mod test {
|
||||
};
|
||||
|
||||
const CHUNK_SIZE: usize = 31;
|
||||
static DOMAIN: Lazy<GeneralEvaluationDomain<Fr>> =
|
||||
Lazy::new(|| GeneralEvaluationDomain::new(128).unwrap());
|
||||
static DOMAIN: LazyLock<GeneralEvaluationDomain<Fr>> =
|
||||
LazyLock::new(|| GeneralEvaluationDomain::new(128).unwrap());
|
||||
#[test]
|
||||
fn encode_random_polynomial() {
|
||||
const N: usize = 100;
|
||||
|
||||
@@ -66,8 +66,7 @@ pub fn fk20_batch_generate_elements_proofs(
|
||||
.collect();
|
||||
Cow::Owned(toeplitz1(&global_parameters, polynomial_degree))
|
||||
};
|
||||
let toeplitz_coefficients: Vec<Fr> = std::iter::repeat(Fr::ZERO)
|
||||
.take(polynomial_degree)
|
||||
let toeplitz_coefficients: Vec<Fr> = std::iter::repeat_n(Fr::ZERO, polynomial_degree)
|
||||
.chain(polynomial.coeffs.iter().copied())
|
||||
.collect();
|
||||
let h_extended_vector = toeplitz2(&toeplitz_coefficients, &extended_vector);
|
||||
@@ -101,10 +100,11 @@ impl Toeplitz1Cache {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use ark_bls12_381::{Bls12_381, Fr};
|
||||
use ark_poly::{univariate::DensePolynomial, EvaluationDomain, GeneralEvaluationDomain};
|
||||
use ark_poly_commit::kzg10::KZG10;
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::SeedableRng;
|
||||
|
||||
use crate::{
|
||||
@@ -114,7 +114,7 @@ mod test {
|
||||
GlobalParameters, Proof, BYTES_PER_FIELD_ELEMENT,
|
||||
};
|
||||
|
||||
static GLOBAL_PARAMETERS: Lazy<GlobalParameters> = Lazy::new(|| {
|
||||
static GLOBAL_PARAMETERS: LazyLock<GlobalParameters> = LazyLock::new(|| {
|
||||
let mut rng = rand::rngs::StdRng::seed_from_u64(1987);
|
||||
KZG10::<Bls12_381, DensePolynomial<Fr>>::setup(4096, true, &mut rng).unwrap()
|
||||
});
|
||||
|
||||
@@ -39,7 +39,7 @@ pub fn generate_element_proof(
|
||||
let u = domain.element(element_index);
|
||||
if u.is_zero() {
|
||||
return Err(KzgRsError::DivisionByZeroPolynomial);
|
||||
};
|
||||
}
|
||||
|
||||
// Instead of evaluating over the polynomial, we can reuse the evaluation points
|
||||
// from the rs encoding let v = polynomial.evaluate(&u);
|
||||
@@ -76,12 +76,13 @@ pub fn verify_element_proof(
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use ark_bls12_381::{Bls12_381, Fr};
|
||||
use ark_poly::{
|
||||
univariate::DensePolynomial, DenseUVPolynomial, EvaluationDomain, GeneralEvaluationDomain,
|
||||
};
|
||||
use ark_poly_commit::kzg10::{UniversalParams, KZG10};
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{thread_rng, Fill};
|
||||
use rayon::{
|
||||
iter::{IndexedParallelIterator, ParallelIterator},
|
||||
@@ -94,7 +95,7 @@ mod test {
|
||||
};
|
||||
|
||||
const COEFFICIENTS_SIZE: usize = 16;
|
||||
static GLOBAL_PARAMETERS: Lazy<UniversalParams<Bls12_381>> = Lazy::new(|| {
|
||||
static GLOBAL_PARAMETERS: LazyLock<UniversalParams<Bls12_381>> = LazyLock::new(|| {
|
||||
let mut rng = rand::thread_rng();
|
||||
KZG10::<Bls12_381, DensePolynomial<Fr>>::setup(
|
||||
crate::kzg::test::COEFFICIENTS_SIZE - 1,
|
||||
@@ -104,8 +105,8 @@ mod test {
|
||||
.unwrap()
|
||||
});
|
||||
|
||||
static DOMAIN: Lazy<GeneralEvaluationDomain<Fr>> =
|
||||
Lazy::new(|| GeneralEvaluationDomain::new(COEFFICIENTS_SIZE).unwrap());
|
||||
static DOMAIN: LazyLock<GeneralEvaluationDomain<Fr>> =
|
||||
LazyLock::new(|| GeneralEvaluationDomain::new(COEFFICIENTS_SIZE).unwrap());
|
||||
#[test]
|
||||
fn test_poly_commit() {
|
||||
let poly = DensePolynomial::from_coefficients_vec((0..10).map(Fr::from).collect());
|
||||
|
||||
@@ -93,9 +93,10 @@ pub fn points_to_bytes<const CHUNK_SIZE: usize>(points: &[Fr]) -> Vec<u8> {
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use std::sync::LazyLock;
|
||||
|
||||
use ark_bls12_381::Fr;
|
||||
use ark_poly::{EvaluationDomain, GeneralEvaluationDomain};
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{thread_rng, Fill};
|
||||
|
||||
use crate::{
|
||||
@@ -104,8 +105,8 @@ mod test {
|
||||
};
|
||||
|
||||
const COEFFICIENTS_SIZE: usize = 32;
|
||||
static DOMAIN: Lazy<GeneralEvaluationDomain<Fr>> =
|
||||
Lazy::new(|| GeneralEvaluationDomain::new(COEFFICIENTS_SIZE).unwrap());
|
||||
static DOMAIN: LazyLock<GeneralEvaluationDomain<Fr>> =
|
||||
LazyLock::new(|| GeneralEvaluationDomain::new(COEFFICIENTS_SIZE).unwrap());
|
||||
|
||||
#[test]
|
||||
fn test_encode_decode() {
|
||||
|
||||
@@ -93,27 +93,27 @@ where
|
||||
&self.replication
|
||||
}
|
||||
|
||||
pub fn sampling_behaviour_mut(&mut self) -> &mut SamplingBehaviour<Membership> {
|
||||
pub const fn sampling_behaviour_mut(&mut self) -> &mut SamplingBehaviour<Membership> {
|
||||
&mut self.sampling
|
||||
}
|
||||
|
||||
pub fn dispersal_executor_behaviour_mut(
|
||||
pub const fn dispersal_executor_behaviour_mut(
|
||||
&mut self,
|
||||
) -> &mut DispersalExecutorBehaviour<Membership> {
|
||||
&mut self.executor_dispersal
|
||||
}
|
||||
|
||||
pub fn dispersal_validator_behaviour_mut(
|
||||
pub const fn dispersal_validator_behaviour_mut(
|
||||
&mut self,
|
||||
) -> &mut DispersalValidatorBehaviour<Membership> {
|
||||
&mut self.validator_dispersal
|
||||
}
|
||||
|
||||
pub fn replication_behaviour_mut(&mut self) -> &mut ReplicationBehaviour<Membership> {
|
||||
pub const fn replication_behaviour_mut(&mut self) -> &mut ReplicationBehaviour<Membership> {
|
||||
&mut self.replication
|
||||
}
|
||||
|
||||
pub fn monitor_behaviour_mut(&mut self) -> &mut ConnectionMonitorBehaviour<Monitor> {
|
||||
pub const fn monitor_behaviour_mut(&mut self) -> &mut ConnectionMonitorBehaviour<Monitor> {
|
||||
&mut self.monitor
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ where
|
||||
&self.monitor
|
||||
}
|
||||
|
||||
pub fn balancer_behaviour_mut(
|
||||
pub const fn balancer_behaviour_mut(
|
||||
&mut self,
|
||||
) -> &mut ConnectionBalancerBehaviour<Balancer, Membership> {
|
||||
&mut self.balancer
|
||||
|
||||
@@ -82,19 +82,21 @@ where
|
||||
&self.replication
|
||||
}
|
||||
|
||||
pub fn sampling_behaviour_mut(&mut self) -> &mut SamplingBehaviour<Membership> {
|
||||
pub const fn sampling_behaviour_mut(&mut self) -> &mut SamplingBehaviour<Membership> {
|
||||
&mut self.sampling
|
||||
}
|
||||
|
||||
pub fn dispersal_behaviour_mut(&mut self) -> &mut DispersalValidatorBehaviour<Membership> {
|
||||
pub const fn dispersal_behaviour_mut(
|
||||
&mut self,
|
||||
) -> &mut DispersalValidatorBehaviour<Membership> {
|
||||
&mut self.dispersal
|
||||
}
|
||||
|
||||
pub fn replication_behaviour_mut(&mut self) -> &mut ReplicationBehaviour<Membership> {
|
||||
pub const fn replication_behaviour_mut(&mut self) -> &mut ReplicationBehaviour<Membership> {
|
||||
&mut self.replication
|
||||
}
|
||||
|
||||
pub fn monitor_behaviour_mut(&mut self) -> &mut ConnectionMonitorBehaviour<Monitor> {
|
||||
pub const fn monitor_behaviour_mut(&mut self) -> &mut ConnectionMonitorBehaviour<Monitor> {
|
||||
&mut self.monitor
|
||||
}
|
||||
|
||||
@@ -102,7 +104,7 @@ where
|
||||
&self.monitor
|
||||
}
|
||||
|
||||
pub fn balancer_behaviour_mut(
|
||||
pub const fn balancer_behaviour_mut(
|
||||
&mut self,
|
||||
) -> &mut ConnectionBalancerBehaviour<Balancer, Membership> {
|
||||
&mut self.balancer
|
||||
|
||||
@@ -325,7 +325,7 @@ where
|
||||
} else {
|
||||
// There is no pending request, so just idle the stream
|
||||
idle_streams.insert(stream.peer_id, stream);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// Get a pending request if its available
|
||||
|
||||
@@ -129,7 +129,7 @@ enum WriteHalfState {
|
||||
}
|
||||
|
||||
impl WriteHalfState {
|
||||
pub fn take(&mut self) -> Self {
|
||||
pub const fn take(&mut self) -> Self {
|
||||
let mut ret = Self::Busy;
|
||||
std::mem::swap(self, &mut ret);
|
||||
ret
|
||||
@@ -714,18 +714,17 @@ where
|
||||
messages.shift_remove(disconnected);
|
||||
// If the marker pointed to the disconnected peer, move it backwards one step,
|
||||
// wrapping around if necessary
|
||||
last_scheduled.and_then(|id| {
|
||||
if id == *disconnected {
|
||||
let i = i.expect("Valid index");
|
||||
if i == 0 {
|
||||
messages.last().map(|(id, _)| *id)
|
||||
} else {
|
||||
messages.get_index(i - 1).map(|(id, _)| *id)
|
||||
}
|
||||
let id = last_scheduled?;
|
||||
if id == *disconnected {
|
||||
let i = i.expect("Valid index");
|
||||
if i == 0 {
|
||||
messages.last().map(|(id, _)| *id)
|
||||
} else {
|
||||
None
|
||||
messages.get_index(i - 1).map(|(id, _)| *id)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
@@ -230,7 +230,7 @@ where
|
||||
&self.swarm
|
||||
}
|
||||
|
||||
pub fn protocol_swarm_mut(
|
||||
pub const fn protocol_swarm_mut(
|
||||
&mut self,
|
||||
) -> &mut Swarm<
|
||||
ExecutorBehaviour<
|
||||
|
||||
@@ -205,7 +205,7 @@ where
|
||||
&self.swarm
|
||||
}
|
||||
|
||||
pub fn protocol_swarm_mut(
|
||||
pub const fn protocol_swarm_mut(
|
||||
&mut self,
|
||||
) -> &mut Swarm<
|
||||
ValidatorBehaviour<
|
||||
|
||||
@@ -171,10 +171,6 @@ where
|
||||
});
|
||||
|
||||
let mut lifecycle_stream = service_state.lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(msg) = persistent_transmission_messages.next() => {
|
||||
|
||||
@@ -562,7 +562,6 @@ where
|
||||
let mut lifecycle_stream = self.service_state.lifecycle_handle.message_stream();
|
||||
|
||||
async {
|
||||
#[expect(clippy::redundant_pub_crate, reason = "Generated by `tokio::select` macro.")]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(block) = incoming_blocks.next() => {
|
||||
|
||||
@@ -528,10 +528,6 @@ where
|
||||
let storage_adapter = DaStorage::new(storage_relay).await;
|
||||
|
||||
let mut lifecycle_stream = service_state.lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(block) = consensus_blocks.next() => {
|
||||
|
||||
@@ -103,10 +103,6 @@ where
|
||||
} = self;
|
||||
|
||||
let mut lifecycle_stream = lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(msg) = inbound_relay.recv() => {
|
||||
|
||||
@@ -146,9 +146,8 @@ impl<R: Rng + Sync + Send> DaSamplingServiceBackend<R> for KzgrsSamplingBackend<
|
||||
}
|
||||
|
||||
fn get_commitments(&self, blob_id: &Self::BlobId) -> Option<Arc<Self::SharesCommitments>> {
|
||||
self.pending_sampling_blobs
|
||||
.get(blob_id)
|
||||
.and_then(|ctx| ctx.commitment.clone())
|
||||
let ctx = self.pending_sampling_blobs.get(blob_id)?;
|
||||
ctx.commitment.clone()
|
||||
}
|
||||
|
||||
fn add_commitments(&mut self, blob_id: &Self::BlobId, commitments: Self::SharesCommitments) {
|
||||
|
||||
@@ -463,10 +463,6 @@ where
|
||||
let mut next_prune_tick = sampler.prune_interval();
|
||||
|
||||
let mut lifecycle_stream = service_state.lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(service_message) = service_state.inbound_relay.recv() => {
|
||||
|
||||
@@ -190,10 +190,6 @@ where
|
||||
let storage_adapter = S::new(storage_relay).await;
|
||||
|
||||
let mut lifecycle_stream = service_state.lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(share) = share_stream.next() => {
|
||||
|
||||
@@ -143,10 +143,6 @@ where
|
||||
mut backend,
|
||||
} = self;
|
||||
let mut lifecycle_stream = service_state.lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(msg) = service_state.inbound_relay.recv() => {
|
||||
|
||||
@@ -55,7 +55,7 @@ impl<RuntimeServiceId> NetworkAdapter<RuntimeServiceId> for MockAdapter<RuntimeS
|
||||
.await
|
||||
{
|
||||
panic!("Couldn't send subscribe message to the network service: {e}",);
|
||||
};
|
||||
}
|
||||
Self { network_relay }
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ impl<RuntimeServiceId> NetworkAdapter<RuntimeServiceId> for MockAdapter<RuntimeS
|
||||
.await
|
||||
{
|
||||
tracing::error!(err = ?e);
|
||||
};
|
||||
}
|
||||
|
||||
let receiver = receiver.await.unwrap();
|
||||
Box::new(Box::pin(BroadcastStream::new(receiver).filter_map(
|
||||
|
||||
@@ -203,7 +203,7 @@ impl Mock {
|
||||
Err(e) => {
|
||||
tracing::error!("error sending message: {:?}", e);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,7 @@ impl Mock {
|
||||
Err(e) => {
|
||||
tracing::error!("error sending message: {:?}", e);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -296,7 +296,7 @@ impl<RuntimeServiceId> NetworkBackend<RuntimeServiceId> for Mock {
|
||||
.unwrap_or_default();
|
||||
let _ = tx.send(msgs);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
async fn subscribe(&mut self, kind: Self::EventKind) -> Receiver<Self::NetworkEvent> {
|
||||
|
||||
@@ -99,10 +99,6 @@ where
|
||||
mut backend,
|
||||
} = self;
|
||||
let mut lifecycle_stream = lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(msg) = inbound_relay.recv() => {
|
||||
|
||||
@@ -135,13 +135,12 @@ impl<SerdeOp: StorageSerde + Send + Sync + 'static> StorageBackend for RocksBack
|
||||
}
|
||||
|
||||
async fn remove(&mut self, key: &[u8]) -> Result<Option<Bytes>, Self::Error> {
|
||||
self.load(key).await.and_then(|val| {
|
||||
if val.is_some() {
|
||||
self.rocks.delete(key).map(|()| val)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
})
|
||||
let val = self.load(key).await?;
|
||||
if val.is_some() {
|
||||
self.rocks.delete(key).map(|()| val)
|
||||
} else {
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
async fn execute(
|
||||
|
||||
@@ -311,10 +311,6 @@ where
|
||||
} = self;
|
||||
let mut lifecycle_stream = lifecycle_handle.message_stream();
|
||||
let backend = &mut backend;
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(msg) = inbound_relay.recv() => {
|
||||
|
||||
@@ -48,10 +48,6 @@ where
|
||||
let Self { service_state } = self;
|
||||
let mut ctrlc = async_ctrlc::CtrlC::new()?;
|
||||
let mut lifecycle_stream = service_state.lifecycle_handle.message_stream();
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
() = &mut ctrlc => {
|
||||
|
||||
@@ -107,10 +107,6 @@ where
|
||||
const SLOTS_BUFFER: usize = 3;
|
||||
let (broadcast_sender, broadcast_receiver) = broadcast::channel(SLOTS_BUFFER);
|
||||
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
loop {
|
||||
tokio::select! {
|
||||
Some(service_message) = inbound_relay.recv() => {
|
||||
|
||||
@@ -290,10 +290,9 @@ mod serde_level {
|
||||
where
|
||||
D: Deserializer<'de>,
|
||||
{
|
||||
<String>::deserialize(deserializer).and_then(|v| {
|
||||
v.parse()
|
||||
.map_err(|e| D::Error::custom(format!("invalid log level {e}")))
|
||||
})
|
||||
let v = <String>::deserialize(deserializer)?;
|
||||
v.parse()
|
||||
.map_err(|e| D::Error::custom(format!("invalid log level {e}")))
|
||||
}
|
||||
|
||||
#[expect(
|
||||
|
||||
+11
-12
@@ -47,18 +47,17 @@ pub mod serde {
|
||||
deserializer: D,
|
||||
) -> Result<[u8; N], D::Error> {
|
||||
use serde::Deserialize;
|
||||
<&[u8]>::deserialize(deserializer).and_then(|bytes| {
|
||||
if bytes.len() == N {
|
||||
let mut output = [0u8; N];
|
||||
output.copy_from_slice(bytes);
|
||||
Ok(output)
|
||||
} else {
|
||||
Err(<D::Error as serde::de::Error>::invalid_length(
|
||||
bytes.len(),
|
||||
&format!("{N}").as_str(),
|
||||
))
|
||||
}
|
||||
})
|
||||
let bytes = <&[u8]>::deserialize(deserializer)?;
|
||||
if bytes.len() == N {
|
||||
let mut output = [0u8; N];
|
||||
output.copy_from_slice(bytes);
|
||||
Ok(output)
|
||||
} else {
|
||||
Err(<D::Error as serde::de::Error>::invalid_length(
|
||||
bytes.len(),
|
||||
&format!("{N}").as_str(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
pub fn deserialize_bytes_array<'de, const N: usize, D: serde::Deserializer<'de>>(
|
||||
|
||||
+4
-1
@@ -4,4 +4,7 @@
|
||||
# * shell.nix
|
||||
# * ci/Dockerfile
|
||||
# * testnet/Dockerfile
|
||||
channel = "1.85.1"
|
||||
# Also, update the version of the nightly toolchain to the latest nightly of the new version specified in the following places:
|
||||
# * workflows/code-check.yml (fmt job)
|
||||
# * .pre-commit-config.yml (fmt hook)
|
||||
channel = "1.86.0"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
overlays = [
|
||||
(import (fetchGit {
|
||||
url = "https://github.com/oxalica/rust-overlay.git";
|
||||
rev = "a0e3395c63cdbc9c1ec17915f8328c077c79c4a1";
|
||||
rev = "c4a8327b0f25d1d81edecbb6105f74d7cf9d7382";
|
||||
}))
|
||||
];
|
||||
}
|
||||
@@ -19,7 +19,7 @@ pkgs.mkShell {
|
||||
pkg-config
|
||||
# Updating the version here requires also updating the `rev` version in the `overlays` section above
|
||||
# with a commit that contains the new version in its manifest
|
||||
rust-bin.stable."1.85.1".default
|
||||
rust-bin.stable."1.86.0".default
|
||||
clang_14
|
||||
llvmPackages_14.libclang
|
||||
openssl.dev
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# BUILD IMAGE ---------------------------------------------------------
|
||||
|
||||
FROM rust:1.85.1-slim-bookworm AS builder
|
||||
FROM rust:1.86.0-slim-bookworm AS builder
|
||||
|
||||
LABEL maintainer="augustinas@status.im" \
|
||||
source="https://github.com/logos-co/nomos-node" \
|
||||
|
||||
@@ -36,7 +36,6 @@ nomos-node = { workspace = true, default-features = false }
|
||||
nomos-time = { workspace = true }
|
||||
nomos-tracing = { workspace = true }
|
||||
nomos-tracing-service = { workspace = true }
|
||||
once_cell = "1"
|
||||
rand = "0.8"
|
||||
reqwest = { workspace = true, features = ["json"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
|
||||
+12
-9
@@ -6,21 +6,23 @@ use std::{
|
||||
env,
|
||||
net::TcpListener,
|
||||
ops::Mul,
|
||||
sync::atomic::{AtomicU16, Ordering},
|
||||
sync::{
|
||||
atomic::{AtomicU16, Ordering},
|
||||
LazyLock,
|
||||
},
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
use nomos_libp2p::{Multiaddr, PeerId, Swarm};
|
||||
use once_cell::sync::Lazy;
|
||||
use rand::{thread_rng, Rng};
|
||||
|
||||
static NET_PORT: Lazy<AtomicU16> =
|
||||
Lazy::new(|| AtomicU16::new(thread_rng().gen_range(8000..10000)));
|
||||
static NET_PORT: LazyLock<AtomicU16> =
|
||||
LazyLock::new(|| AtomicU16::new(thread_rng().gen_range(8000..10000)));
|
||||
|
||||
static IS_SLOW_TEST_ENV: Lazy<bool> =
|
||||
Lazy::new(|| env::var("SLOW_TEST_ENV").is_ok_and(|s| s == "true"));
|
||||
static IS_SLOW_TEST_ENV: LazyLock<bool> =
|
||||
LazyLock::new(|| env::var("SLOW_TEST_ENV").is_ok_and(|s| s == "true"));
|
||||
|
||||
pub static GLOBAL_PARAMS_PATH: Lazy<String> = Lazy::new(|| {
|
||||
pub static GLOBAL_PARAMS_PATH: LazyLock<String> = LazyLock::new(|| {
|
||||
let relative_path = "./kzgrs/kzgrs_test_params";
|
||||
let current_dir = env::current_dir().expect("Failed to get current directory");
|
||||
current_dir
|
||||
@@ -33,8 +35,9 @@ pub static GLOBAL_PARAMS_PATH: Lazy<String> = Lazy::new(|| {
|
||||
|
||||
/// Global flag indicating whether debug tracing configuration is enabled to
|
||||
/// send traces to local grafana stack.
|
||||
pub static IS_DEBUG_TRACING: Lazy<bool> =
|
||||
Lazy::new(|| env::var("NOMOS_TESTS_TRACING").is_ok_and(|val| val.eq_ignore_ascii_case("true")));
|
||||
pub static IS_DEBUG_TRACING: LazyLock<bool> = LazyLock::new(|| {
|
||||
env::var("NOMOS_TESTS_TRACING").is_ok_and(|val| val.eq_ignore_ascii_case("true"))
|
||||
});
|
||||
|
||||
pub fn get_available_port() -> u16 {
|
||||
loop {
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
pub mod executor;
|
||||
pub mod validator;
|
||||
|
||||
use std::ops::Range;
|
||||
use std::{ops::Range, sync::LazyLock};
|
||||
|
||||
use once_cell::sync::Lazy;
|
||||
use reqwest::Client;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tempfile::TempDir;
|
||||
|
||||
const LOGS_PREFIX: &str = "__logs";
|
||||
static CLIENT: Lazy<Client> = Lazy::new(Client::new);
|
||||
static CLIENT: LazyLock<Client> = LazyLock::new(Client::new);
|
||||
|
||||
fn create_tempdir() -> std::io::Result<TempDir> {
|
||||
// It's easier to use the current location instead of OS-default tempfile
|
||||
|
||||
@@ -31,10 +31,6 @@ async fn happy_test(topology: &Topology) {
|
||||
.floor() as u64;
|
||||
let timeout = adjust_timeout(Duration::from_secs(timeout));
|
||||
let timeout = tokio::time::sleep(timeout);
|
||||
#[expect(
|
||||
clippy::redundant_pub_crate,
|
||||
reason = "Generated by `tokio::select` macro."
|
||||
)]
|
||||
{
|
||||
tokio::select! {
|
||||
() = timeout => panic!("timed out waiting for nodes to produce {} blocks", n_blocks),
|
||||
|
||||
@@ -3,6 +3,7 @@ use std::{
|
||||
env,
|
||||
path::PathBuf,
|
||||
str::FromStr,
|
||||
sync::LazyLock,
|
||||
time::Duration,
|
||||
};
|
||||
|
||||
@@ -12,12 +13,11 @@ use nomos_da_network_core::swarm::{
|
||||
};
|
||||
use nomos_libp2p::{ed25519, Multiaddr, PeerId};
|
||||
use nomos_node::NomosDaMembership;
|
||||
use once_cell::sync::Lazy;
|
||||
use subnetworks_assignations::MembershipHandler;
|
||||
|
||||
use crate::{get_available_port, secret_key_to_peer_id};
|
||||
|
||||
pub static GLOBAL_PARAMS_PATH: Lazy<String> = Lazy::new(|| {
|
||||
pub static GLOBAL_PARAMS_PATH: LazyLock<String> = LazyLock::new(|| {
|
||||
let relative_path = "./kzgrs/kzgrs_test_params";
|
||||
let current_dir = env::current_dir().expect("Failed to get current directory");
|
||||
current_dir
|
||||
|
||||
@@ -157,11 +157,19 @@ impl Topology {
|
||||
}
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::missing_const_for_fn,
|
||||
reason = "Using `Deref` which is not const."
|
||||
)]
|
||||
#[must_use]
|
||||
pub fn validators(&self) -> &[Validator] {
|
||||
&self.validators
|
||||
}
|
||||
|
||||
#[expect(
|
||||
clippy::missing_const_for_fn,
|
||||
reason = "Using `Deref` which is not const."
|
||||
)]
|
||||
#[must_use]
|
||||
pub fn executors(&self) -> &[Executor] {
|
||||
&self.executors
|
||||
|
||||
Reference in New Issue
Block a user