forked from FuelLabs/fuel-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sync with peers before producing blocks (FuelLabs#1169)
Closes FuelLabs#1120 After refactoring and enabling `TaskParams` for `Services` in order for them to be turned into `Task` with a `TaskParam`, I created SyncPort, and added it as a `TaskParam` for `poa`'s Service. The current implementation is that the `SyncAdapter` only checks for 60 seconds if a new block was imported, if not, it considers the PoA node to be synced. Improvement on top of this would be - waiting first to connect to N amount of Reserved Peers. --------- Co-authored-by: Green Baneling <XgreenX9999@gmail.com>
- Loading branch information
1 parent
6405e64
commit e4f5d65
Showing
23 changed files
with
750 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
use fuel_core_types::fuel_types::Address; | ||
use fuel_core_types::{ | ||
fuel_tx::Input, | ||
fuel_types::Address, | ||
}; | ||
use serde::{ | ||
Deserialize, | ||
Serialize, | ||
}; | ||
|
||
use crate::default_consensus_dev_key; | ||
|
||
#[derive(Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] | ||
pub enum ConsensusConfig { | ||
PoA { signing_key: Address }, | ||
} | ||
|
||
impl ConsensusConfig { | ||
pub fn default_poa() -> Self { | ||
ConsensusConfig::PoA { | ||
signing_key: Input::owner(&default_consensus_dev_key().public_key()), | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
#![deny(unused_must_use)] | ||
|
||
mod deadline_clock; | ||
mod sync; | ||
|
||
#[cfg(test)] | ||
mod service_test; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.