-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
more fork-choice fixes #1388
more fork-choice fixes #1388
Conversation
arnetheduck
commented
Jul 28, 2020
- use target block/epoch to validate attestations
- make addLocalValidators sync
- add current and previous epoch to cache before doing state transition
- update head state using clearance state as a shortcut, when possible
- use blockslot for fork choice balances
- send attestations using epochref cache
Rebase to fix the build: #1389 |
fd2d6cf
to
8115544
Compare
green now on travis @tersec |
* use target block/epoch to validate attestations * make addLocalValidators sync * add current and previous epoch to cache before doing state transition * update head state using clearance state as a shortcut, when possible * use blockslot for fork choice balances * send attestations using epochref cache
also simplify epoch block traversal
c768813
to
65f93b3
Compare
65f93b3
to
740a8dc
Compare
@@ -273,7 +274,7 @@ proc init*(T: type BeaconNode, | |||
onBeaconBlock(res, signedBlock) | |||
) | |||
|
|||
await res.addLocalValidators() | |||
res.addLocalValidators() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this might create race conditions with other parts of the code perhaps if the local validators aren't yet there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well, the code is more synchronous now without the await because addlocalvalidators is no longer asynchronous (notably, because it no longer has to schedule anything on the async loop)
for e in bs.blck.epochsInfo: | ||
if e.epoch == epoch: | ||
return e | ||
if bs.slot == epoch.compute_start_slot_at_epoch: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't blocks skip slots here, including the first slot of an epoch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's why BlockSlot.parent
moves slot-by-slot instead of block by block :)
On 32-bit Azure |
But regardless, it seemed not to notice/care, and moved on to the next test:
And it's only on 32-bit Azure, and presumably other 32-bit platforms if CI ran them. It's not new from this PR, e..g, #1387 shows the same pattern. 32-bit Azure "fails", but doesn't, and other platforms don't have that issue. |