Skip to content

Commit

Permalink
Remove scan malfeasant flag (#6229)
Browse files Browse the repository at this point in the history
## Motivation

This command line option was added during the last release to allow a node to scan its state during startup for the then newly introduced InvalidPreviousATX malfeasance proof.

Since then all existing ATXs that are invalid have been marked as such and all nodes check newly incoming ATXs directly for their validity. So this isn't needed any more.
  • Loading branch information
fasmat committed Aug 8, 2024
1 parent c25d28c commit e5f41da
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 176 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ See [RELEASE](./RELEASE.md) for workflow instructions.

### Upgrade information

The command line flag `--scan-malfeasant-atxs` has been removed. All malfeasant ATXs before 1.6.0 have been marked as
such and the node will continue to scan new ATXs for their validity.

### Highlights

### Features
Expand Down Expand Up @@ -699,6 +702,7 @@ and permanent ineligibility for rewards.

* [#5494](https://github.com/spacemeshos/go-spacemesh/pull/5494)
Make routing discovery more configurable and less spammy by default.

* [#5511](https://github.com/spacemeshos/go-spacemesh/pull/5511)
Fix dialing peers on their private IPs, which was causing "portscan" complaints.

Expand Down
90 changes: 0 additions & 90 deletions activation/verify_state.go

This file was deleted.

69 changes: 0 additions & 69 deletions activation/verify_state_test.go

This file was deleted.

3 changes: 0 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ func AddFlags(flagSet *pflag.FlagSet, cfg *config.Config) (configPath *string) {
flagSet.DurationVar(&cfg.DatabasePruneInterval, "db-prune-interval",
cfg.DatabasePruneInterval, "configure interval for database pruning")

flagSet.BoolVar(&cfg.ScanMalfeasantATXs, "scan-malfeasant-atxs", cfg.ScanMalfeasantATXs,
"scan for malfeasant ATXs")

flagSet.BoolVar(&cfg.NoMainOverride, "no-main-override",
cfg.NoMainOverride, "force 'nomain' builds to run on the mainnet")

Expand Down
3 changes: 0 additions & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ type BaseConfig struct {

PruneActivesetsFrom types.EpochID `mapstructure:"prune-activesets-from"`

// ScanMalfeasantATXs is a flag to enable scanning for malfeasant ATXs.
ScanMalfeasantATXs bool `mapstructure:"scan-malfeasant-atxs"`

NetworkHRP string `mapstructure:"network-hrp"`

// MinerGoodAtxsPercent is a threshold to decide if tortoise activeset should be
Expand Down
3 changes: 1 addition & 2 deletions config/mainnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ func MainnetConfig() Config {
DatabaseConnections: 16,
DatabasePruneInterval: 30 * time.Minute,
DatabaseVacuumState: 15,
PruneActivesetsFrom: 12, // starting from epoch 13 activesets below 12 will be pruned
ScanMalfeasantATXs: false, // opt-in
PruneActivesetsFrom: 12, // starting from epoch 13 activesets below 12 will be pruned
NetworkHRP: "sm",

LayerDuration: 5 * time.Minute,
Expand Down
9 changes: 0 additions & 9 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -2005,15 +2005,6 @@ func (app *App) setupDBs(ctx context.Context, lg log.Log) error {
datastore.WithConsensusCache(data),
)

if app.Config.ScanMalfeasantATXs {
app.log.With().Info("checking DB for malicious ATXs")
start = time.Now()
if err := activation.CheckPrevATXs(ctx, app.log.Zap(), app.db); err != nil {
return fmt.Errorf("malicious ATX check: %w", err)
}
app.log.With().Info("malicious ATX check completed", log.Duration("duration", time.Since(start)))
}

migrations, err = sql.LocalMigrations()
if err != nil {
return fmt.Errorf("load local migrations: %w", err)
Expand Down

0 comments on commit e5f41da

Please sign in to comment.