diff --git a/core/core.go b/core/core.go index ba014d3adf..9a8d863a71 100644 --- a/core/core.go +++ b/core/core.go @@ -567,11 +567,6 @@ func (c *Core) Snapshots() *snapshot.Tree { return nil } -// this needs to be implemented, it is being used by a lot of modules -func (c *Core) SetHead(number uint64) error { - return nil -} - func (c *Core) TxLookupLimit() uint64 { return 0 } diff --git a/eth/api_backend.go b/eth/api_backend.go index 383b5bca04..62651aef32 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -78,11 +78,6 @@ func (b *QuaiAPIBackend) CalcOrder(header *types.Header) (*big.Int, int, error) return b.eth.core.CalcOrder(header) } -func (b *QuaiAPIBackend) SetHead(number uint64) { - b.eth.handler.downloader.Cancel() - b.eth.core.SetHead(number) -} - func (b *QuaiAPIBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) { // Pending block is only known by the miner if number == rpc.PendingBlockNumber { diff --git a/eth/backend.go b/eth/backend.go index 6e917ed410..2c7b3d1b41 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -114,8 +114,8 @@ func New(stack *node.Node, config *ethconfig.Config) (*Quai, error) { if err != nil { return nil, err } - chainConfig, genesisHash, genesisErr := core.SetupGenesisBlockWithOverride(chainDb, config.Genesis) - if _, ok := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !ok { + chainConfig, _, genesisErr := core.SetupGenesisBlockWithOverride(chainDb, config.Genesis) + if genesisErr != nil { return nil, genesisErr } @@ -181,13 +181,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Quai, error) { } ) - // Rewind the chain in case of an incompatible config upgrade. - if compat, ok := genesisErr.(*params.ConfigCompatError); ok { - log.Warn("Rewinding chain to upgrade configuration", "err", compat) - eth.core.SetHead(compat.RewindTo) - rawdb.WriteChainConfig(chainDb, genesisHash, chainConfig) - } - if config.TxPool.Journal != "" { config.TxPool.Journal = stack.ResolvePath(config.TxPool.Journal) } diff --git a/internal/quaiapi/api.go b/internal/quaiapi/api.go index 5d1ae8ea59..a51710decc 100644 --- a/internal/quaiapi/api.go +++ b/internal/quaiapi/api.go @@ -1518,11 +1518,6 @@ func (api *PrivateDebugAPI) ChaindbCompact() error { return nil } -// SetHead rewinds the head of the blockchain to a previous block. -func (api *PrivateDebugAPI) SetHead(number hexutil.Uint64) { - api.b.SetHead(uint64(number)) -} - // PublicNetAPI offers network related RPC methods type PublicNetAPI struct { net *p2p.Server diff --git a/internal/quaiapi/backend.go b/internal/quaiapi/backend.go index 2f3ca75316..914aa57661 100644 --- a/internal/quaiapi/backend.go +++ b/internal/quaiapi/backend.go @@ -53,7 +53,6 @@ type Backend interface { RPCTxFeeCap() float64 // global tx fee cap for all transaction related APIs // Blockchain API - SetHead(number uint64) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) HeaderByNumberOrHash(ctx context.Context, blockNrOrHash rpc.BlockNumberOrHash) (*types.Header, error)