-
Notifications
You must be signed in to change notification settings - Fork 242
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
integrate light client into beacon node #3557
Conversation
dab8676
to
b290ddf
Compare
|
Note that this PR does not yet take into account GossipSub data. Will submit that separately as it's already quite noisy. GossipSub data can be used to keep |
b290ddf
to
8f9a874
Compare
|
Adds a `LightClient` instance to the beacon node as preparation to accelerate syncing in the future (optimistic sync). - `--light-client-enable` turns on the feature - `--light-client-trusted-block-root` configures block to start from If no block root is configured, light client tracks DAG `finalizedHead`.
LightClientStore
and keep it in sync8f9a874
to
c337959
Compare
|
lightClientEnable* {. | ||
hidden | ||
desc: "BETA: Accelerate sync using light client." | ||
name: "light-client-enable" .}: Option[bool] |
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.
How does this Option
/applyConfigDefault
help?
nimbus-eth2/beacon_chain/nimbus_beacon_node.nim
Lines 1699 to 1709 in 43876fc
template applyConfigDefault(field: untyped): untyped = | |
if config.`field`.isNone: | |
if not metadata.configDefaults.`field`.isZeroMemory: | |
info "Applying network config default", | |
eth2Network = config.eth2Network, | |
`field` = metadata.configDefaults.`field` | |
config.`field` = some metadata.configDefaults.`field` | |
applyConfigDefault(lightClientEnable) | |
applyConfigDefault(serveLightClientData) | |
applyConfigDefault(importLightClientData) |
show the mechanism, but it's not clear to me why this version (see also lightClientTrustedBlockRoot
) is better than the more straightforward Option
-free variation which sets some appropriate default and avoids the Option
-.get()
indirection.
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.
Had it at default-on for kiln/ropsten/prater, but you are right that now with the default off the straight-forward bool
would also work. I guess when optimistic sync is fully implemented, that this would need to be changed to detect the case of "no user preference" vs "user selected off" and apply network specific default in first case. I can get rid of it once more and it can then be reintroduced later, or we can just keep it as is, up to you.
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.
Alright, keep as is.
During the Ropsten change from Altair -> Bellatrix, noticed in the logs that the LC optimistic update for the first slot was not picked up on Gossip, due to the subscription on old net being dropped immediately after bellatrix. Light client uses |
This reverts commit 0d7c822.
Adds a
LightClient
instance to the beacon node as preparation toaccelerate syncing in the future (optimistic sync).
--light-client-enable
turns on the feature--light-client-trusted-block-root
configures block to start fromIf no block root is configured, light client tracks DAG
finalizedHead
.