Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ibalajiarun committed Feb 6, 2024
1 parent f20234c commit e769867
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 21 deletions.
11 changes: 6 additions & 5 deletions consensus/src/dag/dag_driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ impl DagDriver {
(
highest_strong_links_round,
// unwrap is for round 0
dag_reader.get_strong_links_for_round(
highest_strong_links_round,
&self.epoch_state.verifier,
)
.unwrap_or_default(),
dag_reader
.get_strong_links_for_round(
highest_strong_links_round,
&self.epoch_state.verifier,
)
.unwrap_or_default(),
)
};

Expand Down
4 changes: 2 additions & 2 deletions consensus/src/dag/dag_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ impl InMemDag {

pub fn highest_round(&self) -> Round {
// If stale nodes exist on the BTreeMap, ignore their rounds when calculating
// the highest round.
// the highest round.
*self
.nodes_by_round
.last_key_value()
Expand Down Expand Up @@ -455,7 +455,7 @@ impl DagStore {
self.dag.write().validate_new_node(&node)?;

// Note on concurrency: it is possible that a prune operation kicks in here and
// moves the window forward making the `node` stale. Any stale node inserted
// moves the window forward making the `node` stale. Any stale node inserted
// due to this race will be cleaned up with the next prune operation.

// mutate after all checks pass
Expand Down
4 changes: 2 additions & 2 deletions consensus/src/dag/health/chain_health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl ChainHealthBackoff {
impl TChainHealth for ChainHealthBackoff {
fn get_round_backoff(&self, round: Round) -> Option<Duration> {
let chain_health_backoff = self.get_chain_health_backoff(round);

if let Some(value) = chain_health_backoff {
CHAIN_HEALTH_BACKOFF_TRIGGERED.observe(1.0);
Some(Duration::from_millis(value.backoff_proposal_delay_ms))
Expand All @@ -80,7 +80,7 @@ impl TChainHealth for ChainHealthBackoff {

fn get_round_payload_limits(&self, round: Round) -> Option<(u64, u64)> {
let chain_health_backoff = self.get_chain_health_backoff(round);

chain_health_backoff.map(|value| {
(
value.max_sending_block_txns_override,
Expand Down
25 changes: 14 additions & 11 deletions consensus/src/dag/rb_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,21 @@
// SPDX-License-Identifier: Apache-2.0

use super::{dag_store::DagStore, health::HealthBackoff};
use crate::{dag::{
dag_fetcher::TFetchRequester,
dag_network::RpcHandler,
errors::NodeBroadcastHandleError,
observability::{
logging::{LogEvent, LogSchema},
tracing::{observe_node, NodeStage},
use crate::{
dag::{
dag_fetcher::TFetchRequester,
dag_network::RpcHandler,
errors::NodeBroadcastHandleError,
observability::{
logging::{LogEvent, LogSchema},
tracing::{observe_node, NodeStage},
},
storage::DAGStorage,
types::{Node, NodeCertificate, Vote},
NodeId,
},
storage::DAGStorage,
types::{Node, NodeCertificate, Vote},
NodeId,
}, util::is_vtxn_expected};
util::is_vtxn_expected,
};
use anyhow::{bail, ensure};
use aptos_config::config::DagPayloadConfig;
use aptos_consensus_types::common::{Author, Round};
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/dag/tests/order_rule_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use crate::dag::{
adapter::OrderedNotifier,
anchor_election::RoundRobinAnchorElection,
dag_store::{InMemDag, DagStore},
dag_store::{DagStore, InMemDag},
order_rule::OrderRule,
tests::{
dag_test::MockStorage,
Expand Down

0 comments on commit e769867

Please sign in to comment.