Skip to content

Commit

Permalink
remove useless code
Browse files Browse the repository at this point in the history
  • Loading branch information
blxdyx committed Jul 29, 2024
1 parent 3797cbe commit 54a75ef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 48 deletions.
9 changes: 9 additions & 0 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1608,3 +1608,12 @@ func (c *Parlia) GetTransferFunc() evmtypes.TransferFunc {
func (c *Parlia) GetPostApplyMessageFunc() evmtypes.PostApplyMessageFunc {
return nil
}

func (p *Parlia) blockTimeVerifyForRamanujanFork(snap *Snapshot, header, parent *types.Header) error {
if p.chainConfig.IsRamanujan(header.Number.Uint64()) {
if header.Time < parent.Time+p.config.Period+backOffTime(snap, header, header.Coinbase, p.chainConfig) {
return fmt.Errorf("header %d, time %d, now %d, period: %d, backof: %d, %w", header.Number.Uint64(), header.Time, time.Now().Unix(), p.config.Period, backOffTime(snap, header, header.Coinbase, p.chainConfig), consensus.ErrFutureBlock)
}
}
return nil
}
45 changes: 0 additions & 45 deletions consensus/parlia/ramanujanfork.go

This file was deleted.

4 changes: 1 addition & 3 deletions eth/stagedsync/stage_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,7 @@ func FillDBFromSnapshots(logPrefix string, ctx context.Context, tx kv.RwTx, dirs
if engine != nil && engine.Type() == chain.ParliaConsensus {
// consensus may have own database, let's fill it
// different consensuses may have some conditions for validators snapshots
need := false
need = (blockNum-1)%parlia.CheckpointInterval == 0
if need {
if (blockNum-1)%parlia.CheckpointInterval == 0 {
if err := engine.VerifyHeader(chainReader, header, true /* seal */); err != nil {
return err
}
Expand Down

0 comments on commit 54a75ef

Please sign in to comment.