Fix bug with epoch of attestation votes

This commit is contained in:
Paul Hauner
2020-01-16 09:10:53 +11:00
parent 85e761e563
commit 2366c9ae48
3 changed files with 6 additions and 10 deletions

View File

@@ -1057,10 +1057,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
{
// Provide the attestation to fork choice, updating the validator latest messages but
// _without_ finding and updating the head.
if let Err(e) = self
.fork_choice
.process_attestation(&state, &attestation, block)
{
if let Err(e) = self.fork_choice.process_attestation(&state, &attestation) {
error!(
self.log,
"Add attestation to fork choice failed";

View File

@@ -285,7 +285,7 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
.backend
.contains_block(&attestation.data.beacon_block_root)
{
self.process_attestation(state, attestation, block)?;
self.process_attestation(state, attestation)?;
}
}
@@ -311,7 +311,6 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
&self,
state: &BeaconState<T::EthSpec>,
attestation: &Attestation<T::EthSpec>,
block: &BeaconBlock<T::EthSpec>,
) -> Result<()> {
let timer = metrics::start_timer(&metrics::FORK_CHOICE_PROCESS_ATTESTATION_TIMES);
@@ -340,7 +339,7 @@ impl<T: BeaconChainTypes> ForkChoice<T> {
self.backend.process_attestation(
validator_index,
block_hash,
block.slot.epoch(T::EthSpec::slots_per_epoch()),
attestation.data.target.epoch,
)?;
}
}