Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
arun-koshy committed May 24, 2023
1 parent 7266cd2 commit 4c442e1
Show file tree
Hide file tree
Showing 39 changed files with 259 additions and 262 deletions.
1 change: 1 addition & 0 deletions crates/sui-core/src/consensus_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ mod tests {
consensus_adapter::consensus_tests::{test_certificates, test_gas_objects},
consensus_validator::{SuiTxValidator, SuiTxValidatorMetrics},
};

use narwhal_test_utils::{get_protocol_config, latest_protocol_version};
use narwhal_types::Batch;
use narwhal_worker::TransactionValidator;
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-core/src/narwhal_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,23 @@ pub struct NarwhalManager {

impl NarwhalManager {
pub fn new(
protocol_config: ProtocolConfig,
config: NarwhalConfiguration,
metrics: NarwhalManagerMetrics,
protocol_config: ProtocolConfig,
) -> Self {
// Create the Narwhal Primary with configuration
let primary_node = PrimaryNode::new(
protocol_config.clone(),
config.parameters.clone(),
true,
config.registry_service.clone(),
protocol_config.clone(),
);

// Create Narwhal Workers with configuration
let worker_nodes = WorkerNodes::new(
config.registry_service.clone(),
config.parameters.clone(),
protocol_config,
config.parameters.clone(),
);

let store_cache_metrics =
Expand Down
2 changes: 1 addition & 1 deletion crates/sui-core/src/unit_tests/narwhal_manager_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ async fn test_narwhal_manager() {
let metrics = NarwhalManagerMetrics::new(&Registry::new());

let narwhal_manager =
NarwhalManager::new(narwhal_config, metrics, latest_protocol_version());
NarwhalManager::new(latest_protocol_version(), narwhal_config, metrics);

// start narwhal
narwhal_manager
Expand Down
6 changes: 3 additions & 3 deletions crates/sui-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,10 +660,10 @@ impl SuiNode {
&registry_service.default_registry(),
));
let narwhal_manager = Self::construct_narwhal_manager(
epoch_store.protocol_config().clone(),
config,
consensus_config,
registry_service,
epoch_store.protocol_config().clone(),
)?;

let mut narwhal_epoch_data_remover =
Expand Down Expand Up @@ -829,10 +829,10 @@ impl SuiNode {
}

fn construct_narwhal_manager(
protocol_config: ProtocolConfig,
config: &NodeConfig,
consensus_config: &ConsensusConfig,
registry_service: &RegistryService,
protocol_config: ProtocolConfig,
) -> Result<NarwhalManager> {
let narwhal_config = NarwhalConfiguration {
primary_keypair: config.protocol_key_pair().copy(),
Expand All @@ -846,9 +846,9 @@ impl SuiNode {
let metrics = NarwhalManagerMetrics::new(&registry_service.default_registry());

Ok(NarwhalManager::new(
protocol_config,
narwhal_config,
metrics,
protocol_config,
))
}

Expand Down
2 changes: 1 addition & 1 deletion crates/sui-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const MAX_PROTOCOL_VERSION: u64 = 12;
// framework changes.
// Version 11: Introduce `std::type_name::get_with_original_ids` to the system frameworks.
// Version 12: Changes to deepbook in framework to add API for querying marketplace.
// Change NW entities to use versioned metadata field.
// Change NW Batch to use versioned metadata field.

#[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct ProtocolVersion(u64);
Expand Down
Loading

0 comments on commit 4c442e1

Please sign in to comment.