Graduate Orphaned Attestation Insertion Feature (#10622)

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Nishant Das
2022-05-04 21:59:41 +08:00
committed by GitHub
parent d2dbc13427
commit f9b4a340a3
5 changed files with 6 additions and 27 deletions

View File

@@ -355,10 +355,6 @@ func (s *Service) notifyNewHeadEvent(
// attestation pool. It also filters out the attestations that is one epoch older as a
// defense so invalid attestations don't flow into the attestation pool.
func (s *Service) saveOrphanedAtts(ctx context.Context, orphanedRoot [32]byte) error {
if !features.Get().CorrectlyInsertOrphanedAtts {
return nil
}
orphanedBlk, err := s.cfg.BeaconDB.Block(ctx, orphanedRoot)
if err != nil {
return err

View File

@@ -10,7 +10,6 @@ import (
testDB "github.com/prysmaticlabs/prysm/beacon-chain/db/testing"
doublylinkedtree "github.com/prysmaticlabs/prysm/beacon-chain/forkchoice/doubly-linked-tree"
"github.com/prysmaticlabs/prysm/beacon-chain/state/stategen"
"github.com/prysmaticlabs/prysm/config/features"
"github.com/prysmaticlabs/prysm/config/params"
types "github.com/prysmaticlabs/prysm/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/consensus-types/wrapper"
@@ -231,11 +230,6 @@ func Test_notifyNewHeadEvent(t *testing.T) {
}
func TestSaveOrphanedAtts(t *testing.T) {
resetCfg := features.InitWithReset(&features.Flags{
CorrectlyInsertOrphanedAtts: true,
})
defer resetCfg()
genesis, keys := util.DeterministicGenesisState(t, 64)
b, err := util.GenerateFullBlock(genesis, keys, util.DefaultBlockGenConfig(), 1)
assert.NoError(t, err)
@@ -259,11 +253,6 @@ func TestSaveOrphanedAtts(t *testing.T) {
}
func TestSaveOrphanedAtts_CanFilter(t *testing.T) {
resetCfg := features.InitWithReset(&features.Flags{
CorrectlyInsertOrphanedAtts: true,
})
defer resetCfg()
genesis, keys := util.DeterministicGenesisState(t, 64)
b, err := util.GenerateFullBlock(genesis, keys, util.DefaultBlockGenConfig(), 1)
assert.NoError(t, err)

View File

@@ -60,7 +60,6 @@ type Flags struct {
EnableSlashingProtectionPruning bool
// Bug fixes related flags.
CorrectlyInsertOrphanedAtts bool
CorrectlyPruneCanonicalAtts bool
EnableNativeState bool // EnableNativeState defines whether the beacon state will be represented as a pure Go struct or a Go struct that wraps a proto struct.
@@ -164,11 +163,6 @@ func ConfigureBeaconChain(ctx *cli.Context) {
log.WithField(enableHistoricalSpaceRepresentation.Name, enableHistoricalSpaceRepresentation.Usage).Warn(enabledFeatureFlag)
cfg.EnableHistoricalSpaceRepresentation = true
}
cfg.CorrectlyInsertOrphanedAtts = true
if ctx.Bool(disableCorrectlyInsertOrphanedAtts.Name) {
logDisabled(disableCorrectlyInsertOrphanedAtts)
cfg.CorrectlyInsertOrphanedAtts = false
}
cfg.CorrectlyPruneCanonicalAtts = true
if ctx.Bool(disableCorrectlyPruneCanonicalAtts.Name) {
logDisabled(disableCorrectlyPruneCanonicalAtts)

View File

@@ -105,6 +105,11 @@ var (
Usage: deprecatedUsage,
Hidden: true,
}
deprecatedDisableCorrectlyInsertOrphanedAtts = &cli.BoolFlag{
Name: "disable-correctly-insert-orphaned-atts",
Usage: deprecatedUsage,
Hidden: true,
}
)
var deprecatedFlags = []cli.Flag{
@@ -126,4 +131,5 @@ var deprecatedFlags = []cli.Flag{
deprecatedDisableActiveBalanceCache,
deprecatedDisableBalanceTrieComputation,
deprecatedDisableBatchGossipVerification,
deprecatedDisableCorrectlyInsertOrphanedAtts,
}

View File

@@ -91,11 +91,6 @@ var (
" (Warning): Once enabled, this feature migrates your database in to a new schema and " +
"there is no going back. At worst, your entire database might get corrupted.",
}
disableCorrectlyInsertOrphanedAtts = &cli.BoolFlag{
Name: "disable-correctly-insert-orphaned-atts",
Usage: "Disable the fix for bug where orphaned attestations don't get reinserted back to mem pool. Which is an improves validator profitability and overall network health," +
"see issue #9441 for further detail",
}
disableCorrectlyPruneCanonicalAtts = &cli.BoolFlag{
Name: "disable-correctly-prune-canonical-atts",
Usage: "Disable the fix for bug where any block attestations can get incorrectly pruned, which improves validator profitability and overall network health," +
@@ -158,7 +153,6 @@ var BeaconChainFlags = append(deprecatedFlags, []cli.Flag{
disableBroadcastSlashingFlag,
enableSlasherFlag,
enableHistoricalSpaceRepresentation,
disableCorrectlyInsertOrphanedAtts,
disableCorrectlyPruneCanonicalAtts,
enableNativeState,
enableVecHTR,