diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 3f334dc7c0..92e9ce4ff0 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1939,8 +1939,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { cfg.TransactionHistory = 0 log.Warn("Disabled transaction unindexing for archive node") - cfg.StateScheme = rawdb.HashScheme - log.Warn("Forcing hash state-scheme for archive mode") + // cfg.StateScheme = rawdb.HashScheme + // log.Warn("Forcing hash state-scheme for archive mode") } if ctx.IsSet(CacheFlag.Name) || ctx.IsSet(CacheTrieFlag.Name) { cfg.TrieCleanCache = ctx.Int(CacheFlag.Name) * ctx.Int(CacheTrieFlag.Name) / 100 @@ -2089,7 +2089,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { if rawdb.ReadCanonicalHash(chaindb, 0) != (common.Hash{}) { cfg.Genesis = nil // fallback to db content - //validate genesis has PoS enabled in block 0 + // validate genesis has PoS enabled in block 0 genesis, err := core.ReadGenesis(chaindb) if err != nil { Fatalf("Could not read genesis from database: %v", err) diff --git a/core/blockchain.go b/core/blockchain.go index 62b1e56f60..c924bef8b9 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -2008,7 +2008,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) go throwaway.TriePrefetchInAdvance(block, signer) } - //Process block using the parent state as reference point + // Process block using the parent state as reference point if bc.pipeCommit { statedb.EnablePipeCommit() } @@ -2273,7 +2273,7 @@ func (bc *BlockChain) insertSideChain(block *types.Block, it *insertIterator) (i parent = bc.GetHeader(parent.ParentHash, parent.Number.Uint64()-1) } if parent == nil { - return it.index, errors.New("missing parent") + return it.index, errors.New("555 missing parent") } // Import all the pruned blocks to make the state available var ( @@ -2343,7 +2343,7 @@ func (bc *BlockChain) recoverAncestors(block *types.Block) (common.Hash, error) } } if parent == nil { - return common.Hash{}, errors.New("missing parent") + return common.Hash{}, errors.New("666 missing parent") } // Import all the pruned blocks to make the state available for i := len(hashes) - 1; i >= 0; i-- { diff --git a/core/rawdb/accessors_trie.go b/core/rawdb/accessors_trie.go index 886c1c469b..00053ea328 100644 --- a/core/rawdb/accessors_trie.go +++ b/core/rawdb/accessors_trie.go @@ -338,8 +338,8 @@ func ParseStateScheme(provided string, disk ethdb.Database) (string, error) { stored := ReadStateScheme(disk) if provided == "" { if stored == "" { - log.Info("State scheme set to default", "scheme", "path") - return PathScheme, nil // use default scheme for empty database + log.Info("State scheme set to default", "scheme", "hash") + return HashScheme, nil // use default scheme for empty database } log.Info("State scheme set to already existing disk db", "scheme", stored) return stored, nil // reuse scheme of persistent scheme diff --git a/eth/downloader/downloader.go b/eth/downloader/downloader.go index 7e7e63bef9..afc5d286d2 100644 --- a/eth/downloader/downloader.go +++ b/eth/downloader/downloader.go @@ -1097,7 +1097,7 @@ func (d *Downloader) fetchHeaders(p *peerConnection, from uint64, head uint64) e filled, hashset, proced, err := d.fillHeaderSkeleton(from, headers) if err != nil { p.log.Debug("Skeleton chain invalid", "err", err) - return fmt.Errorf("%w: %v", errInvalidChain, err) + return fmt.Errorf("111 %w: %v", errInvalidChain, err) } headers = filled[proced:] hashes = hashset[proced:] @@ -1305,7 +1305,7 @@ func (d *Downloader) processHeaders(origin uint64, td, ttd *big.Int, beaconMode if len(chunkHeaders) > 0 { if n, err := d.lightchain.InsertHeaderChain(chunkHeaders); err != nil { log.Warn("Invalid header encountered", "number", chunkHeaders[n].Number, "hash", chunkHashes[n], "parent", chunkHeaders[n].ParentHash, "err", err) - return fmt.Errorf("%w: %v", errInvalidChain, err) + return fmt.Errorf("222 %w: %v", errInvalidChain, err) } } } @@ -1402,7 +1402,7 @@ func (d *Downloader) importBlockResults(results []*fetchResult) error { if errors.Is(err, core.ErrAncestorHasNotBeenVerified) { return err } - return fmt.Errorf("%w: %v", errInvalidChain, err) + return fmt.Errorf("333 %w: %v", errInvalidChain, err) } return nil } @@ -1600,7 +1600,7 @@ func (d *Downloader) commitSnapSyncData(results []*fetchResult, stateSync *state } if index, err := d.blockchain.InsertReceiptChain(blocks, receipts, d.ancientLimit); err != nil { log.Debug("Downloaded item processing failed", "number", results[index].Header.Number, "hash", results[index].Header.Hash(), "err", err) - return fmt.Errorf("%w: %v", errInvalidChain, err) + return fmt.Errorf("444 %w: %v", errInvalidChain, err) } return nil } diff --git a/miner/worker.go b/miner/worker.go index ba5afdf41f..9043f03a88 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -957,7 +957,7 @@ func (w *worker) prepareWork(genParams *generateParams) (*environment, error) { if genParams.parentHash != (common.Hash{}) { block := w.chain.GetBlockByHash(genParams.parentHash) if block == nil { - return nil, errors.New("missing parent") + return nil, errors.New("777 missing parent") } parent = block.Header() }