-
Notifications
You must be signed in to change notification settings - Fork 231
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 efficient forkchoiceUpdated usage #4055
Conversation
@@ -47,6 +48,10 @@ type | |||
# ---------------------------------------------------------------- | |||
eth1Monitor*: Eth1Monitor | |||
|
|||
# Allow determination of whether there's an upcoming proposal | |||
# ---------------------------------------------------------------- | |||
attachedValidators*: ref ValidatorPool |
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.
we need to consider proposers that come in via rest api as well
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.
ActionTracker
could be an alternative that takes care of VCs, no?
func getNextProposalSlot*(tracker: ActionTracker, slot: Slot): 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.
2809f41 uses getNextProposalSlot
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.
looking over the code, in addition to the action tracker we should also be checking https://github.com/status-im/nimbus-eth2/blob/7cac6f46db950ed7bdf758f82d3533526a1c1f4f/beacon_chain/spec/eth2_apis/dynamic_fee_recipients.nim which collects calls from https://ethereum.github.io/beacon-APIs/#/Validator/prepareBeaconProposer which is the offiical way of preparing - actiontracker derives "active" proposers from attestations which is a good enough proxy in many cases but not all
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.
Has risk of false positives, but if people prefer that, sure.
88e16cf
to
e93c995
Compare
…slot proposal; use wall slot + 1 rather than state slot + 1 to correctly check when missing blocks
# Some attached validator is next proposer, so prepare payload. As | ||
# updateHead() updated the DAG head, runProposalForkchoiceUpdated, | ||
# which needs the state corresponding to that head block, can run. | ||
asyncSpawn self.consensusManager.runProposalForkchoiceUpdated( |
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.
is the spawn here guaranteed to complete before the next fcu call?
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.
As far as Nimbus is concerned, yes
nimbus-eth2/beacon_chain/consensus_object_pools/consensus_manager.nim
Lines 304 to 319 in e367f61
try: | |
let fcResult = awaitWithTimeout( | |
forkchoiceUpdated( | |
self.eth1Monitor, | |
headBlockRoot, | |
beaconHead.safeExecutionPayloadHash, | |
beaconHead.finalizedExecutionPayloadHash, | |
timestamp, randomData, feeRecipient), | |
FORKCHOICEUPDATED_TIMEOUT): | |
debug "runProposalForkchoiceUpdated: forkchoiceUpdated timed out" | |
ForkchoiceUpdatedResponse( | |
payloadStatus: PayloadStatusV1(status: PayloadExecutionStatus.syncing)) | |
if fcResult.payloadStatus.status != PayloadExecutionStatus.valid or | |
fcResult.payloadId.isNone: | |
return |
FORKCHOICEUPDATED_TIMEOUT
is 8 seconds.
# TODO after things stabilize with this, check for upcoming proposal and | ||
# don't bother sending first fcU, but initially, keep both in place | ||
asyncSpawn self.runProposalForkchoiceUpdated() | ||
if self.checkNextProposer(wallSlot).isSome: |
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 is called inside rpfu as well?
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.
No description provided.