advance FC time if block/attestation is early (#4992)
When processing blocks/attestations that are slightly early, within the spec allowed `MAXIMUM_GOSSIP_CLOCK_DISPARITY`, bump FC time accordingly.
This commit is contained in:
parent
1f535336da
commit
750722dd75
|
@ -215,7 +215,7 @@ proc on_attestation*(
|
||||||
attesting_indices: openArray[ValidatorIndex],
|
attesting_indices: openArray[ValidatorIndex],
|
||||||
wallTime: BeaconTime
|
wallTime: BeaconTime
|
||||||
): FcResult[void] =
|
): FcResult[void] =
|
||||||
? self.update_time(dag, wallTime)
|
? self.update_time(dag, max(wallTime, attestation_slot.start_beacon_time))
|
||||||
|
|
||||||
if beacon_block_root.isZero:
|
if beacon_block_root.isZero:
|
||||||
return ok()
|
return ok()
|
||||||
|
@ -266,7 +266,7 @@ proc process_block*(self: var ForkChoice,
|
||||||
unrealized: FinalityCheckpoints,
|
unrealized: FinalityCheckpoints,
|
||||||
blck: ForkyTrustedBeaconBlock,
|
blck: ForkyTrustedBeaconBlock,
|
||||||
wallTime: BeaconTime): FcResult[void] =
|
wallTime: BeaconTime): FcResult[void] =
|
||||||
? update_time(self, dag, wallTime)
|
? update_time(self, dag, max(wallTime, blckRef.slot.start_beacon_time))
|
||||||
|
|
||||||
for attester_slashing in blck.body.attester_slashings:
|
for attester_slashing in blck.body.attester_slashings:
|
||||||
for idx in getValidatorIndices(attester_slashing):
|
for idx in getValidatorIndices(attester_slashing):
|
||||||
|
|
Loading…
Reference in New Issue