Merge branch 'master' into signature-scheme-update

This commit is contained in:
Kirk Baird
2019-02-23 13:34:57 +11:00
15 changed files with 636 additions and 187 deletions

View File

@@ -357,6 +357,7 @@ where
self.fork_choice.write().add_attestation(
free_attestation.validator_index,
&free_attestation.data.beacon_block_root,
&self.spec,
)?;
Ok(aggregation_outcome)
}
@@ -486,7 +487,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.
//
@@ -575,7 +578,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

View File

@@ -5,4 +5,4 @@ mod checkpoint;
pub use self::beacon_chain::{BeaconChain, Error};
pub use self::checkpoint::CheckPoint;
pub use fork_choice::{ForkChoice, ForkChoiceAlgorithms, ForkChoiceError};
pub use fork_choice::{ForkChoice, ForkChoiceAlgorithm, ForkChoiceError};