Add stubbed-out block processing to fork choice

This commit is contained in:
Paul Hauner
2019-06-16 16:39:48 -04:00
parent f6c86d0f7f
commit 9c2bbb6c05
4 changed files with 23 additions and 6 deletions

View File

@@ -624,7 +624,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
self.store.put(&state_root, &state)?;
// Register the new block with the fork choice service.
self.fork_choice.process_block(&state, &block)?;
self.fork_choice.process_block(&state, &block, block_root)?;
// Execute the fork choice algorithm, enthroning a new head if discovered.
//

View File

@@ -89,6 +89,7 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
&self,
state: &BeaconState<T::EthSpec>,
block: &BeaconBlock,
block_root: Hash256,
) -> Result<()> {
// Note: we never count the block as a latest message, only attestations.
//
@@ -100,6 +101,8 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
self.process_attestation_from_block(state, attestation)?;
}
self.backend.process_block(block_root, block.slot)?;
Ok(())
}
@@ -138,7 +141,7 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
for validator_index in validator_indices {
self.backend
.process_message(validator_index, block_hash, block_slot)?;
.process_attestation(validator_index, block_hash, block_slot)?;
}
}