mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 14:24:44 +00:00
Add stubbed-out block processing to fork choice
This commit is contained in:
@@ -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.
|
||||
//
|
||||
|
||||
@@ -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)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user