Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
goshawk authored and goshawk-3 committed Jan 12, 2024
1 parent 05574d6 commit aaeacc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions node/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ mod fallback;
mod fsm;
mod genesis;

mod header_validation;

use self::acceptor::Acceptor;
use self::fsm::SimpleFSM;
use crate::database::Ledger;
Expand Down
11 changes: 5 additions & 6 deletions node/src/chain/acceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ impl<DB: database::DB, VM: vm::VMExecution, N: Network> Acceptor<N, DB, VM> {
}

async fn spawn_task(&self) {
let provisioners = self.provisioners_list.read().await.to_current();
let provisioners_list = self.provisioners_list.read().await.clone();

self.task.write().await.spawn(
self.mrb.read().await.inner(),
Arc::new(provisioners),
provisioners_list,
&self.db,
&self.vm,
&self.network,
Expand Down Expand Up @@ -374,7 +374,7 @@ impl<DB: database::DB, VM: vm::VMExecution, N: Network> Acceptor<N, DB, VM> {
if enable_consensus {
task.spawn(
mrb.inner(),
Arc::new(provisioners_list.to_current()),
provisioners_list.clone(),
&self.db,
&self.vm,
&self.network,
Expand Down Expand Up @@ -473,8 +473,7 @@ impl<DB: database::DB, VM: vm::VMExecution, N: Network> Acceptor<N, DB, VM> {
pub(crate) async fn restart_consensus(&mut self) {
let mut task = self.task.write().await;
let mrb = self.mrb.read().await;
let provisioners_list =
self.provisioners_list.read().await.to_current();
let provisioners_list = self.provisioners_list.read().await.clone();

task.abort_with_wait().await;
info!(
Expand All @@ -486,7 +485,7 @@ impl<DB: database::DB, VM: vm::VMExecution, N: Network> Acceptor<N, DB, VM> {

task.spawn(
mrb.inner(),
Arc::new(provisioners_list),
provisioners_list,
&self.db,
&self.vm,
&self.network,
Expand Down
2 changes: 1 addition & 1 deletion node/src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// Copyright (c) DUSK NETWORK. All rights reserved.

use dusk_consensus::{
contract_state::CallParams, contract_state::VerificationOutput,
operations::CallParams, operations::VerificationOutput,
user::provisioners::Provisioners,
};
use node_data::ledger::{Block, SpentTransaction, Transaction};
Expand Down

0 comments on commit aaeacc3

Please sign in to comment.