-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Proposer head v5 #12075
Proposer head v5 #12075
Conversation
"github.com/prysmaticlabs/prysm/v3/encoding/bytesutil" | ||
ethpb "github.com/prysmaticlabs/prysm/v3/proto/prysm/v1alpha1" | ||
"github.com/prysmaticlabs/prysm/v3/time/slots" | ||
"github.com/sirupsen/logrus" | ||
"go.opencensus.io/trace" | ||
) | ||
|
||
// reorgLateBlockCountAttestations is the time until the end of the slot in which we count | ||
// attestations to see if we will reorg the incoming block | ||
const reorgLateBlockCountAttestations = 2 * time.Second |
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.
The naming is a little weird, I also prefer 2 more than 10 than having 12-2...
log.WithError(err).Error("Could not process attestations and update head") | ||
} | ||
// process attestations and update head in forkchoice | ||
vs.ForkFetcher.ForkChoicer().Lock() |
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.
Wow. we missed the lock before?
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.
Yep, I always had it but the locking mechanism moved from within UpdateHead to here
@@ -182,6 +183,11 @@ func ConfigureBeaconChain(ctx *cli.Context) error { | |||
logDisabled(disablePeerScorer) | |||
cfg.EnablePeerScorer = false | |||
} | |||
cfg.DisableReorgLateBlocks = true |
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.
Optional, I wish we have EnableReorgLateBlocks
instead of DisableReorgLateBlocks
. The flag is enable-reorg-late-blocks
and it makes everything a bit easier to read
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.
I want to make this default later, so the permanent config will be Disable, that's why I internally made this so that the changes are minimal when we flip the flag
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.
Besides the naming consideration, I dont have any further feedback. This looks good to me. The feature flag rename will be in the subsequent PR
This PR adds reorg logic when proposing a block via
GetBeaconBlock
. It fixes a bug that is introduced in #12034 in which this PR is based.