Skip to content

Commit

Permalink
Merge branch 'main' into lr/variable-stake-table
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszrzasik authored Nov 25, 2024
2 parents 0a598ac + 64d5f16 commit dd51a2a
Show file tree
Hide file tree
Showing 39 changed files with 99 additions and 71 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/typos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Typos

on:
push:
branches:
- main
- release-*
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
typos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout Repository

- name: typos-action
uses: crate-ci/[email protected]
5 changes: 5 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[files]
extend-exclude = [
"*.drawio",
"crates/orchestrator/run-config.toml"
]
24 changes: 12 additions & 12 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion crates/example-types/src/auction_results_provider_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl HasUrls for TestAuctionResult {
/// The test auction results type is used to mimic the results from the Solver.
#[derive(Clone, Debug, Default)]
pub struct TestAuctionResultsProvider<TYPES: NodeType> {
/// We intentionally allow for the results to be pre-cooked for the unit test to gurantee a
/// We intentionally allow for the results to be pre-cooked for the unit test to guarantee a
/// particular outcome is met.
pub solver_results: TYPES::AuctionResult,

Expand Down
2 changes: 1 addition & 1 deletion crates/example-types/src/block_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ pub struct TestBlockHeader {
pub payload_commitment: VidCommitment,
/// Fast commitment for builder verification
pub builder_commitment: BuilderCommitment,
/// block metdata
/// block metadata
pub metadata: TestMetadata,
/// Timestamp when this header was created.
pub timestamp: u64,
Expand Down
4 changes: 2 additions & 2 deletions crates/example-types/src/storage_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ impl<TYPES: NodeType> Storage<TYPES> for TestStorage<TYPES> {
}
async fn update_undecided_state(
&self,
_leafs: CommitmentMap<Leaf<TYPES>>,
_leaves: CommitmentMap<Leaf<TYPES>>,
_state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Result<()> {
if self.should_return_err {
Expand All @@ -237,7 +237,7 @@ impl<TYPES: NodeType> Storage<TYPES> for TestStorage<TYPES> {
}
async fn update_undecided_state2(
&self,
_leafs: CommitmentMap<Leaf2<TYPES>>,
_leaves: CommitmentMap<Leaf2<TYPES>>,
_state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Result<()> {
if self.should_return_err {
Expand Down
2 changes: 1 addition & 1 deletion crates/examples/infra/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ pub trait RunDa<
let total_time_elapsed = start.elapsed(); // in seconds
println!("[{node_index}]: {rounds} rounds completed in {total_time_elapsed:?} - Total transactions sent: {total_transactions_sent} - Total transactions committed: {total_transactions_committed} - Total commitments: {num_successful_commits}");
if total_transactions_committed != 0 {
// prevent devision by 0
// prevent division by 0
let total_time_elapsed_sec = std::cmp::max(total_time_elapsed.as_secs(), 1u64);
// extra 8 bytes for timestamp
let throughput_bytes_per_sec = total_transactions_committed
Expand Down
22 changes: 11 additions & 11 deletions crates/hotshot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> SystemContext<T
}
}

let interal_chan = broadcast(EVENT_CHANNEL_SIZE);
let internal_chan = broadcast(EVENT_CHANNEL_SIZE);
let external_chan = broadcast(EXTERNAL_EVENT_CHANNEL_SIZE);

Self::new_from_channels(
Expand All @@ -243,7 +243,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> SystemContext<T
metrics,
storage,
marketplace_config,
interal_chan,
internal_chan,
external_chan,
)
}
Expand All @@ -253,7 +253,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> SystemContext<T
/// To do a full initialization, use `fn init` instead, which will set up background tasks as
/// well.
///
/// Use this function if you want to use some prexisting channels and to spin up the tasks
/// Use this function if you want to use some preexisting channels and to spin up the tasks
/// and start consensus manually. Mostly useful for tests
#[allow(clippy::too_many_arguments, clippy::type_complexity)]
pub fn new_from_channels(
Expand Down Expand Up @@ -326,7 +326,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>, V: Versions> SystemContext<T
let mut saved_payloads = BTreeMap::new();
saved_leaves.insert(anchored_leaf.commit(), anchored_leaf.clone());

for leaf in initializer.undecided_leafs {
for leaf in initializer.undecided_leaves {
saved_leaves.insert(leaf.commit(), leaf.clone());
}
if let Some(payload) = anchored_leaf.block_payload() {
Expand Down Expand Up @@ -999,9 +999,9 @@ pub struct HotShotInitializer<TYPES: NodeType> {
/// If it's given, we'll use it to construct the `SystemContext`.
state_delta: Option<Arc<<TYPES::ValidatedState as ValidatedState<TYPES>>::Delta>>,

/// Starting view number that should be equivelant to the view the node shut down with last.
/// Starting view number that should be equivalent to the view the node shut down with last.
start_view: TYPES::View,
/// Starting epoch number that should be equivelant to the epoch the node shut down with last.
/// Starting epoch number that should be equivalent to the epoch the node shut down with last.
start_epoch: TYPES::Epoch,
/// The view we last performed an action in. An action is Proposing or voting for
/// Either the quorum or DA.
Expand All @@ -1012,9 +1012,9 @@ pub struct HotShotInitializer<TYPES: NodeType> {
high_qc: QuorumCertificate2<TYPES>,
/// Previously decided upgrade certificate; this is necessary if an upgrade has happened and we are not restarting with the new version
decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>,
/// Undecided leafs that were seen, but not yet decided on. These allow a restarting node
/// Undecided leaves that were seen, but not yet decided on. These allow a restarting node
/// to vote and propose right away if they didn't miss anything while down.
undecided_leafs: Vec<Leaf2<TYPES>>,
undecided_leaves: Vec<Leaf2<TYPES>>,
/// Not yet decided state
undecided_state: BTreeMap<TYPES::View, View<TYPES>>,
/// Proposals we have sent out to provide to others for catchup
Expand All @@ -1041,7 +1041,7 @@ impl<TYPES: NodeType> HotShotInitializer<TYPES> {
saved_proposals: BTreeMap::new(),
high_qc,
decided_upgrade_certificate: None,
undecided_leafs: Vec::new(),
undecided_leaves: Vec::new(),
undecided_state: BTreeMap::new(),
instance_state,
})
Expand All @@ -1065,7 +1065,7 @@ impl<TYPES: NodeType> HotShotInitializer<TYPES> {
saved_proposals: BTreeMap<TYPES::View, Proposal<TYPES, QuorumProposal2<TYPES>>>,
high_qc: QuorumCertificate2<TYPES>,
decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>,
undecided_leafs: Vec<Leaf2<TYPES>>,
undecided_leaves: Vec<Leaf2<TYPES>>,
undecided_state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Self {
Self {
Expand All @@ -1079,7 +1079,7 @@ impl<TYPES: NodeType> HotShotInitializer<TYPES> {
saved_proposals,
high_qc,
decided_upgrade_certificate,
undecided_leafs,
undecided_leaves,
undecided_state,
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/hotshot/src/traits/networking/libp2p_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,14 +968,14 @@ impl<T: NodeType> ConnectedNetwork<T::SignatureKey> for Libp2pNetwork<T> {

/// The libp2p view update is a special operation intrinsic to its internal behavior.
///
/// Libp2p needs to do a lookup because a libp2p address is not releated to
/// Libp2p needs to do a lookup because a libp2p address is not related to
/// hotshot keys. So in libp2p we store a mapping of HotShot key to libp2p address
/// in a distributed hash table.
///
/// This means to directly message someone on libp2p we need to lookup in the hash
/// table what their libp2p address is, using their HotShot public key as the key.
///
/// So the logic with libp2p is to prefetch upcomming leaders libp2p address to
/// So the logic with libp2p is to prefetch upcoming leaders libp2p address to
/// save time when we later need to direct message the leader our vote. Hence the
/// use of the future view and leader to queue the lookups.
async fn update_view<'a, TYPES>(&'a self, view: u64, epoch: u64, membership: &TYPES::Membership)
Expand Down
4 changes: 2 additions & 2 deletions crates/hotshot/src/types/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES> + 'static, V: Versions>
self.output_event_stream.1.activate_cloned()
}

/// Message other participents with a serialized message from the application
/// Message other participants with a serialized message from the application
/// Receivers of this message will get an `Event::ExternalMessageReceived` via
/// the event stream.
///
Expand Down Expand Up @@ -197,7 +197,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES> + 'static, V: Versions>
if commit == leaf_commitment {
return Ok(quorum_proposal.clone());
}
tracing::warn!("Proposal receied from request has different commitment than expected.\nExpected = {:?}\nReceived{:?}", leaf_commitment, commit);
tracing::warn!("Proposal received from request has different commitment than expected.\nExpected = {:?}\nReceived{:?}", leaf_commitment, commit);
}
}
})
Expand Down
2 changes: 1 addition & 1 deletion crates/libp2p-networking/src/network/behaviours/dht/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ impl<K: SignatureKey + 'static> DHTBehaviour<K> {
}
}

/// Send that the bootsrap suceeded
/// Send that the bootstrap succeeded
fn finish_bootstrap(&mut self) {
if let Some(mut tx) = self.bootstrap_tx.clone() {
spawn(async move { tx.send(bootstrap::InputEvent::BootstrapFinished).await });
Expand Down
2 changes: 1 addition & 1 deletion crates/libp2p-networking/src/network/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub struct NetworkDef<K: SignatureKey + 'static> {
#[debug(skip)]
pub direct_message: cbor::Behaviour<Vec<u8>, Vec<u8>>,

/// Auto NAT behaviour to determine if we are publically reachable and
/// Auto NAT behaviour to determine if we are publicly reachable and
/// by which address
#[debug(skip)]
pub autonat: libp2p::autonat::Behaviour,
Expand Down
2 changes: 1 addition & 1 deletion crates/libp2p-networking/src/network/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl<T: NodeType> NetworkNode<T> {
}

/// event handler for client events
/// currectly supported actions include
/// currently supported actions include
/// - shutting down the swarm
/// - gossipping a message to known peers on the `global` topic
/// - returning the id of the current peer
Expand Down
2 changes: 1 addition & 1 deletion crates/orchestrator/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub struct BenchResultsDownloadConfig {
// Results starting here
/// Whether the results are partially collected
/// "One" when the results are collected for one node
/// "Half" when the results are collecte for half running nodes if not all nodes terminate successfully
/// "Half" when the results are collective for half running nodes if not all nodes terminate successfully
/// "Full" if the results are successfully collected from all nodes
pub partial_results: String,
/// The average latency of the transactions
Expand Down
2 changes: 1 addition & 1 deletion crates/task-impls/src/consensus/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub async fn send_high_qc<TYPES: NodeType, V: Versions, I: NodeImplementation<TY
let version = task_state.upgrade_lock.version(new_view_number).await?;
ensure!(
version >= V::Epochs::VERSION,
debug!("HotStuff 2 updgrade not yet in effect")
debug!("HotStuff 2 upgrade not yet in effect")
);
let high_qc = task_state.consensus.read().await.high_qc().clone();
let leader = task_state
Expand Down
2 changes: 1 addition & 1 deletion crates/task-impls/src/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl<
return Err(());
}
// If the action was view sync record it as a vote, but we don't
// want to limit to 1 View sycn vote above so change the action here.
// want to limit to 1 View sync vote above so change the action here.
if matches!(action, HotShotAction::ViewSyncVote) {
action = HotShotAction::Vote;
}
Expand Down
6 changes: 3 additions & 3 deletions crates/task-impls/src/quorum_proposal/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(crate) enum ProposalDependency {
/// For the `Qc2Formed` event timeout branch.
TimeoutCert,

/// For the `QuroumProposalRecv` event.
/// For the `QuorumProposalRecv` event.
Proposal,

/// For the `VidShareValidated` event.
Expand Down Expand Up @@ -112,7 +112,7 @@ pub struct ProposalDependencyHandle<TYPES: NodeType, V: Versions> {
/// The time this view started
pub view_start_time: Instant,

/// The higest_qc we've seen at the start of this task
/// The highest_qc we've seen at the start of this task
pub highest_qc: QuorumCertificate2<TYPES>,

/// Number of blocks in an epoch, zero means there are no epochs
Expand Down Expand Up @@ -142,7 +142,7 @@ impl<TYPES: NodeType, V: Versions> ProposalDependencyHandle<TYPES, V> {
None
}
/// Waits for the ocnfigured timeout for nodes to send HighQc messages to us. We'll
/// then propose with the higest QC from among these proposals.
/// then propose with the highest QC from among these proposals.
async fn wait_for_highest_qc(&mut self) {
tracing::error!("waiting for QC");
// If we haven't upgraded to Hotstuff 2 just return the high qc right away
Expand Down
2 changes: 1 addition & 1 deletion crates/task-impls/src/quorum_proposal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub struct QuorumProposalTaskState<TYPES: NodeType, I: NodeImplementation<TYPES>
/// Number of blocks in an epoch, zero means there are no epochs
pub epoch_height: u64,

/// The higest_qc we've seen at the start of this task
/// The highest_qc we've seen at the start of this task
pub highest_qc: QuorumCertificate2<TYPES>,
}

Expand Down
2 changes: 1 addition & 1 deletion crates/task-impls/src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl<TYPES: NodeType, I: NodeImplementation<TYPES>> NetworkRequestState<TYPES, I
} else {
// This shouldnt be possible `recipients_it.next()` should clone original and start over if `None`
tracing::warn!(
"Sent VID request to all available DA members and got no reponse for view: {:?}",
"Sent VID request to all available DA members and got no response for view: {:?}",
view
);
return;
Expand Down
Loading

0 comments on commit dd51a2a

Please sign in to comment.