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

Feature/typos 1 #4745

Closed
wants to merge 4 commits into from
Closed
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
24 changes: 24 additions & 0 deletions _typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[files]
extend-exclude = [
"lcov.info",
"massa-node/base_config/*.json",
"*.patch"
]

[default]
extend-ignore-re = [
# Note:
# Address (AU, AS): 32 - 62 characters
# Secret key (S): 18 - 62 characters
# Public key (P): 18 - 62 characters
# NodeId (N)
"(AU|AS|N|S|P)\\d\\w{18,62}"
]

[default.extend-words]
# short: serialize
ser = "ser"
# short: deserialize
der = "der"
# short: numerator
numer = "numer"
2 changes: 1 addition & 1 deletion massa-api-exports/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl std::fmt::Display for CompactAddressInfo {
}
}

/// filter used when retrieving address informations
/// filter used when retrieving address information
#[derive(Debug, Deserialize, Clone, Serialize)]
pub struct AddressFilter {
/// Address
Expand Down
2 changes: 1 addition & 1 deletion massa-api-exports/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl std::fmt::Display for OperationInfo {
"operation is not final",
"finality unknown"
),
display_option_bool(self.op_exec_status, "succes", "failed", "status unknown")
display_option_bool(self.op_exec_status, "success", "failed", "status unknown")
)?;
writeln!(f, "In blocks:")?;
for block_id in &self.in_blocks {
Expand Down
2 changes: 1 addition & 1 deletion massa-api/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl MassaApiServer for API<ApiV2> {
}
}

// Brodcast the stream(sender) content via a WebSocket
// Broadcast the stream(sender) content via a WebSocket
async fn broadcast_via_ws<T: Serialize + Send + Clone + 'static>(
sender: tokio::sync::broadcast::Sender<T>,
pending: PendingSubscriptionSink,
Expand Down
4 changes: 2 additions & 2 deletions massa-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ pub struct Private {
pub struct ApiV2 {
/// link to the consensus component
pub consensus_controller: Box<dyn ConsensusController>,
/// channels with informations broadcasted by the consensus
/// channels with information broadcasted by the consensus
pub consensus_broadcasts: ConsensusBroadcasts,
/// link to the execution component
pub execution_controller: Box<dyn ExecutionController>,
/// channels with informations broadcasted by the pool
/// channels with information broadcasted by the pool
pub pool_broadcasts: PoolBroadcasts,
/// API settings
pub api_settings: APIConfig,
Expand Down
2 changes: 1 addition & 1 deletion massa-async-pool/src/changes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ mod tests {
assert!(msg.can_be_executed);
}
_ => {
panic!("Unexpect value");
panic!("Unexpected value");
}
}

Expand Down
2 changes: 1 addition & 1 deletion massa-async-pool/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1284,7 +1284,7 @@ mod tests {
.write_batch(batch, versioning_batch, Some(slot_1));

let content = dump_column(pool.db.clone(), "state");
assert_eq!(content.len(), 26); // 2 entries added, splitted in 13 prefix
assert_eq!(content.len(), 26); // 2 entries added, split in 13 prefix

let mut batch2 = DBBatch::new();
pool.delete_entry(&message_id, &mut batch2);
Expand Down
24 changes: 14 additions & 10 deletions massa-bootstrap/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ pub fn get_state(
genesis_timestamp: MassaTime,
end_timestamp: Option<MassaTime>,
restart_from_snapshot_at_period: Option<u64>,
interupted: Arc<(Mutex<bool>, Condvar)>,
interrupted: Arc<(Mutex<bool>, Condvar)>,
massa_metrics: MassaMetrics,
) -> Result<GlobalBootstrapState, BootstrapError> {
massa_trace!("bootstrap.lib.get_state", {});
Expand Down Expand Up @@ -490,8 +490,12 @@ pub fn get_state(

let limit = bootstrap_config.rate_limit;
loop {
// check for interuption
if *interupted.0.lock().expect("double-lock on interupt-mutex") {
// check for interruption
if *interrupted
.0
.lock()
.expect("double-lock on interrupt-mutex")
{
return Err(BootstrapError::Interrupted(
"Sig INT received while getting state".to_string(),
));
Expand Down Expand Up @@ -547,11 +551,11 @@ pub fn get_state(

// Before, we would use a simple sleep(...), and that was fine
// in a cancellable async context: the runtime could
// catch the interupt signal, and just cancel this thread:
// catch the interrupt signal, and just cancel this thread:
//
// let state = tokio::select!{
// /* detect interupt */ => /* return, cancelling the async get_state */
// get_state(...) => well, we got the state, and it didn't have to worry about interupts
// /* detect interrupt */ => /* return, cancelling the async get_state */
// get_state(...) => well, we got the state, and it didn't have to worry about interrupts
// };
//
// Without an external system to preempt this context, we use a condvar to manage the sleep.
Expand All @@ -562,14 +566,14 @@ pub fn get_state(
// The _magic_ happens when, somewhere else, a clone of the Arc<(Mutex<bool>, Condvar)>\
// calls Condvar::notify_[one | all], which prompts this thread to wake up. Assuming that
// the mutex-wrapped variable has been set appropriately before the notify, this thread
let int_sig = interupted
let int_sig = interrupted
.0
.lock()
.expect("double-lock() on interupted signal mutex");
let wake = interupted
.expect("double-lock() on interrupted signal mutex");
let wake = interrupted
.1
.wait_timeout(int_sig, bootstrap_config.retry_delay.to_duration())
.expect("interupt signal mutex poisoned");
.expect("interrupt signal mutex poisoned");
if *wake.0 {
return Err(BootstrapError::Interrupted(
"Sig INT during bootstrap retry-wait".to_string(),
Expand Down
4 changes: 2 additions & 2 deletions massa-bootstrap/src/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,10 +870,10 @@ impl Deserializer<BootstrapClientMessage> for BootstrapClientMessageDeserializer
context("Failed last_slot deserialization", |input| {
self.slot_deserializer.deserialize(input)
}),
context("Faild last_state_step deserialization", |input| {
context("Failed last_state_step deserialization", |input| {
self.state_step_deserializer.deserialize(input)
}),
context("Faild last_versioning_step deserialization", |input| {
context("Failed last_versioning_step deserialization", |input| {
self.state_step_deserializer.deserialize(input)
}),
context("Failed last_consensus_step deserialization", |input| {
Expand Down
8 changes: 4 additions & 4 deletions massa-bootstrap/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
//! Shares an `Arc<RwLock>>` guarded list of white and blacklists with the main worker.
//! Periodically does a read-only check to see if list needs updating.
//! Creates an updated list then swaps it out with write-locked list
//! Assuming no errors in code, this is the only write occurance, and is only a pointer-swap
//! under the hood, making write contention virtually non-existant.
//! Assuming no errors in code, this is the only write occurrence, and is only a pointer-swap
//! under the hood, making write contention virtually non-existent.
//!
//! # Worker loop
//!
//! 1. Checks if the stopper has been invoked.
//! 2. Checks if the client is permited under the white/black list rules
//! 2. Checks if the client is permitted under the white/black list rules
//! 3. Checks if there are not too many active sessions already
//! 4. Checks if the client has attempted too recently
//! 5. All checks have passed: spawn a thread on which to run the bootstrap session
Expand Down Expand Up @@ -105,7 +105,7 @@ impl BootstrapManager {
/// stop the bootstrap server
pub fn stop(self) -> Result<(), BootstrapError> {
massa_trace!("bootstrap.lib.stop", {});
// TODO: Refactor the waker so that its existance is tied to the life of the event-loop
// TODO: Refactor the waker so that its existence is tied to the life of the event-loop
if self.listener_stopper.stop().is_err() {
warn!("bootstrap server already dropped");
}
Expand Down
2 changes: 1 addition & 1 deletion massa-bootstrap/src/tests/binders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ fn test_binders_simple() {
// This test uses exactly the same principle as the `test_binders_simple` one
// Except instead of passing a pair of (ServerMessage, ClientMessage), it will pass a
// (bool, Vec<ServerMessage>, Vec<ClientMessage>)
// - The boolean defines wether the server or the client will transmit data first, or receive first
// - The boolean defines whether the server or the client will transmit data first, or receive first
// - The first vector is a list of server messages generated that the server has to send
// - The second vector is a list of client messages generated that the client has to send
// Because the direction of the first message is randomly assigned, and the number of messages are random,
Expand Down
8 changes: 4 additions & 4 deletions massa-bootstrap/src/tests/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ impl BootstrapServerMessage {
"Error in the code of the test for faulty_part 4"
);
}
// No limit on the size of this except the u64 boundery
// No limit on the size of this except the u64 boundary
let updates_on_previous_elements = BTreeMap::new();
let mut change_id = gen_random_slot(rng);
if faulty_part == BootstrapServerMessageFaultyPart::StateChangeIdThreadOverflow {
Expand Down Expand Up @@ -830,7 +830,7 @@ impl BootstrapServerMessage {
new_elements.insert(key, value);
new_elements_size += key_len + value_len;
}
// No limit on the size of this except the u64 boundery
// No limit on the size of this except the u64 boundary
let updates_on_previous_elements = BTreeMap::new();
let mut change_id = gen_random_slot(rng);
if faulty_part == BootstrapServerMessageFaultyPart::VersioningChangeIdThreadOverflow {
Expand Down Expand Up @@ -1020,7 +1020,7 @@ impl BootstrapServerMessage {
},
) => {
let state_equal = stream_batch_equal(state1, state2);
let versionning_equal = stream_batch_equal(v1, v2);
let versioning_equal = stream_batch_equal(v1, v2);
let mut consensus_equal = true;
if c1.final_blocks.len() != c2.final_blocks.len() {
return false;
Expand All @@ -1034,7 +1034,7 @@ impl BootstrapServerMessage {
}
(s1 == s2)
&& state_equal
&& versionning_equal
&& versioning_equal
&& consensus_equal
&& (co1 == co2)
&& (lp1 == lp2)
Expand Down
2 changes: 1 addition & 1 deletion massa-client/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub enum Style {
Wallet,
/// For any secret information
Secret,
/// To separate some informations on the screen by barely visible characters
/// To separate some information on the screen by barely visible characters
Separator,
/// When displaying a timestamp or date
Time,
Expand Down
4 changes: 2 additions & 2 deletions massa-consensus-worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
//! The consensus worker launches a persistent thread that will run in the background.
//! This thread has a `run` function that triggers the consensus algorithm each slot. It can be interrupted by commands
//! that are managed on the fly. The consensus worker share a state with a controller. This controller can be called by the others modules.
//! It avoid sending message to the thread just for getting informations on the consensus.
//! It avoids sending message to the thread just for getting information on the consensus.
//!
//! Communications with execution is blocking. Communications with protocol blocks on sending information to protocol but not blocking
//! when protocol sends informations to this module.
//! when protocol sends information to this module.
//!
//! This module doesn't use asynchronous code.
//!
Expand Down
2 changes: 1 addition & 1 deletion massa-consensus-worker/src/state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl ConsensusState {
&self,
end_slot: Option<Slot>,
) -> Result<PreHashSet<BlockId>, ConsensusError> {
// if an end_slot is provided compute the lastest final block for that given slot
// if an end_slot is provided compute the latest final block for that given slot
// if not use the latest_final_blocks_periods
let effective_latest_finals: Vec<(BlockId, u64)> = if let Some(slot) = end_slot {
self.list_latest_final_blocks_at(slot)?
Expand Down
2 changes: 1 addition & 1 deletion massa-consensus-worker/src/state/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use crate::state::{

use super::ConsensusState;

/// All informations necessary to add a block to the graph
/// All information necessary to add a block to the graph
pub(crate) struct BlockInfos {
/// The block creator
pub creator: PublicKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ fn test_fts_multiple_max_cliques_2() {
register_block(&consensus_controller, block_1_3.clone(), storage.clone());

// Period 2.
// Thread incompatibilies with every blocks of period 1
// Thread incompatibilities with every block of period 1
let block_2_0 = create_block(
Slot::new(2, 0),
vec![genesis[0], genesis[1], genesis[2], genesis[3]],
Expand Down
2 changes: 1 addition & 1 deletion massa-db-worker/src/massa_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1087,7 +1087,7 @@ mod test {
// assert!(dump_column(db_.clone(), "versioning").is_empty());
assert!(dump_column(db.clone(), "versioning").is_empty());

// Add some datas then remove using prefix
// Add some data then remove using prefix
batch.clear();
db.read()
.put_or_update_entry_value(&mut batch, vec![97, 98, 1], &[1]);
Expand Down
6 changes: 3 additions & 3 deletions massa-execution-exports/src/mapping_grpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ pub fn to_querystate_filter(
}
//TODO to be checked
exec::RequestItem::CycleInfos(value) => {
let addreses = value
let addresses = value
.restrict_to_addresses
.into_iter()
.map(|address| Address::from_str(&address))
.collect::<Result<Vec<_>, _>>()?;
let mut addresses_set = PreHashSet::with_capacity(addreses.len());
addresses_set.extend(addreses);
let mut addresses_set = PreHashSet::with_capacity(addresses.len());
addresses_set.extend(addresses);
Ok(ExecutionQueryRequestItem::CycleInfos {
cycle: value.cycle,
restrict_to_addresses: Some(addresses_set),
Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/active_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl ActiveHistory {
}

/// Gets the deferred credits for a given address that will be credited at a given slot
pub(crate) fn get_adress_deferred_credit_for(
pub(crate) fn get_address_deferred_credit_for(
&self,
addr: &Address,
slot: &Slot,
Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ impl ExecutionContext {
// Set the event index
event.context.index_in_slot = self.created_event_index;

// Increment the event counter fot this slot
// Increment the event counter for this slot
self.created_event_index += 1;

// Add the event to the context store
Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/speculative_executed_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl SpeculativeExecutedOps {

/// Checks if an operation was executed previously
pub fn is_op_executed(&self, op_id: &OperationId) -> bool {
// check in the curent changes
// check in the current changes
if self.executed_ops.contains_key(op_id) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/speculative_roll_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ impl SpeculativeRollState {
if let Some(v) = self
.active_history
.read()
.get_adress_deferred_credit_for(addr, slot)
.get_address_deferred_credit_for(addr, slot)
{
return Some(v);
}
Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/tests/scenarios_mandatories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2946,7 +2946,7 @@ fn test_dump_block() {
std::thread::sleep(Duration::from_secs(1));

// if the the storage backend for the dump-block feature is a rocksdb, this
// is mandatory (the db must be closed before we can reopen it to ckeck the
// is mandatory (the db must be closed before we can reopen it to check the
// data)
drop(universe);

Expand Down
2 changes: 1 addition & 1 deletion massa-execution-worker/src/tests/tests_active_history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn test_active_history_deferred_credits() {
let active_history = ActiveHistory(VecDeque::from([exec_output_1]));

assert_eq!(
active_history.get_adress_deferred_credit_for(&addr1, &slot2),
active_history.get_address_deferred_credit_for(&addr1, &slot2),
Some(amount_a1_s2)
);

Expand Down
2 changes: 1 addition & 1 deletion massa-factory-worker/src/block_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl BlockFactoryWorker {
.channels
.pool
.get_block_endorsements(&same_thread_parent_id, &slot);
//TODO: Do we want ot populate only with endorsement id in the future ?
//TODO: Do we want to populate only with endorsement id in the future ?
let endorsements: Vec<SecureShareEndorsement> = {
let endo_read = endo_storage.read_endorsements();
endorsements_ids
Expand Down
10 changes: 5 additions & 5 deletions massa-grpc/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ where
}

let cert = std::fs::read_to_string(config.server_certificate_path.clone())
.expect("error, failed to read server certificat");
.expect("error, failed to read server certificate");
let key = std::fs::read_to_string(config.server_private_key_path.clone())
.expect("error, failed to read server private key");

Expand Down Expand Up @@ -324,7 +324,7 @@ fn generate_self_signed_certificates(config: &GrpcConfig) {
gen_signed_cert(&ca_cert, config.subject_alt_names.clone())
.expect("error, failed to generate cert");
std::fs::write(config.client_certificate_path.clone(), client_cert_pem)
.expect("error, failed to write client certificat");
.expect("error, failed to write client certificate");
std::fs::write(
config.client_private_key_path.clone(),
client_private_key_pem,
Expand All @@ -333,13 +333,13 @@ fn generate_self_signed_certificates(config: &GrpcConfig) {
}

std::fs::write(config.certificate_authority_root_path.clone(), ca_cert_pem)
.expect("error, failed to write certificat authority root");
.expect("error, failed to write certificate authority root");

let (cert_pem, server_private_key_pem) =
gen_signed_cert(&ca_cert, config.subject_alt_names.clone())
.expect("error, failed to generate server certificat");
.expect("error, failed to generate server certificate");
std::fs::write(config.server_certificate_path.clone(), cert_pem)
.expect("error, failed to write server certificat");
.expect("error, failed to write server certificate");
std::fs::write(
config.server_private_key_path.clone(),
server_private_key_pem,
Expand Down
Loading
Loading