mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 13:54:44 +00:00
Merge branch 'master' into beacon-state-caching
This commit is contained in:
@@ -359,6 +359,7 @@ where
|
||||
self.fork_choice.write().add_attestation(
|
||||
free_attestation.validator_index,
|
||||
&free_attestation.data.beacon_block_root,
|
||||
&self.spec,
|
||||
)?;
|
||||
Ok(aggregation_outcome)
|
||||
}
|
||||
@@ -488,7 +489,9 @@ where
|
||||
self.state_store.put(&state_root, &ssz_encode(&state)[..])?;
|
||||
|
||||
// run the fork_choice add_block logic
|
||||
self.fork_choice.write().add_block(&block, &block_root)?;
|
||||
self.fork_choice
|
||||
.write()
|
||||
.add_block(&block, &block_root, &self.spec)?;
|
||||
|
||||
// If the parent block was the parent_block, automatically update the canonical head.
|
||||
//
|
||||
@@ -569,7 +572,10 @@ where
|
||||
pub fn fork_choice(&self) -> Result<(), Error> {
|
||||
let present_head = self.finalized_head().beacon_block_root;
|
||||
|
||||
let new_head = self.fork_choice.write().find_head(&present_head)?;
|
||||
let new_head = self
|
||||
.fork_choice
|
||||
.write()
|
||||
.find_head(&present_head, &self.spec)?;
|
||||
|
||||
if new_head != present_head {
|
||||
let block = self
|
||||
|
||||
@@ -6,4 +6,4 @@ pub use self::beacon_chain::{
|
||||
BeaconChain, BlockProcessingOutcome, Error, InvalidBlock, ValidBlock,
|
||||
};
|
||||
pub use self::checkpoint::CheckPoint;
|
||||
pub use fork_choice::{ForkChoice, ForkChoiceAlgorithms, ForkChoiceError};
|
||||
pub use fork_choice::{ForkChoice, ForkChoiceAlgorithm, ForkChoiceError};
|
||||
|
||||
Reference in New Issue
Block a user