-
Notifications
You must be signed in to change notification settings - Fork 233
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
Fix yet another epoch slot issue #123
Conversation
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.
this seems a bit wrong in that if you update node.beaconState
directly, that updated slot number will stay when processBlocks
is called, causing us to skip the actual update.. no?
notice "Unexpected block slot number - stackTrace incoming", | ||
blockSlot = humaneSlotNum blck.slot, | ||
stateSlot = humaneSlotNum state.slot | ||
writeStackTrace() |
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.
remove debugging cruft?
@@ -397,23 +399,29 @@ proc processBlock( | |||
return false | |||
|
|||
if not processRandao(state, blck, flags): | |||
notice "Randao failure" |
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.
these should already log at the error site, with more pertinent information (where the initial error is detected)
debug "TRACE - updateState", | ||
oldStateSlot = humaneSlotNum state.slot, | ||
proposedBlockSlot = if new_block.isSome(): new_block.get.slot.humaneSlotNum | ||
else: 1010101010 |
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.
what?
addTimer(at) do (p: pointer): | ||
# Chronicles is not GC-safe | ||
debugEcho "TRACE - in closure: currentSlot ", humaneSlotNum node.beaconState.slot |
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.
..
#125 probably fixes this issue |
Actually I wanted to get more input from @zah to make sure the copy was still needed, hence I left the debug output so that he can reproduce and check. |
Deprecated asyncDiscard() procedure. Bump version to 2.5.2.
This fixes #101 and add several more tracing, the gist of it is that we were making our updates on a copy of our state.
It does not seem like the copy is needed anymore (pending CI).
In summary I think that this goes one step beyond the branch https://github.com/status-im/nim-beacon-chain/tree/yglukhov-somewhat-stable-simulation
I definitely felt the tangle while trying to debug it (cf: #117 (comment)). I think we need a refactoring as soon as phase 0 stabilizes.
Next steps
Note that we still have block slot issues, but the new one seems to need moving or reordering core part of the processing as we:
With the assert being at the soon infamous :) "Could this fail somehow"
https://github.com/status-im/nim-beacon-chain/blob/e1efdd4349a35903861a5384df0a96f07005fa56/beacon_chain/beacon_node.nim#L220-L229