Skip to content

Commit b9450bf

Browse files
authored
core, eth: typos and some code formatting (#28201)
* fix: typo * feat: revert symbol name
1 parent 46c850a commit b9450bf

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

core/blockchain.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ func (bc *BlockChain) SetHead(head uint64) error {
576576
header := bc.CurrentBlock()
577577
block := bc.GetBlock(header.Hash(), header.Number.Uint64())
578578
if block == nil {
579-
// This should never happen. In practice, previsouly currentBlock
579+
// This should never happen. In practice, previously currentBlock
580580
// contained the entire block whereas now only a "marker", so there
581581
// is an ever so slight chance for a race we should handle.
582582
log.Error("Current block not found in database", "block", header.Number, "hash", header.Hash())
@@ -598,7 +598,7 @@ func (bc *BlockChain) SetHeadWithTimestamp(timestamp uint64) error {
598598
header := bc.CurrentBlock()
599599
block := bc.GetBlock(header.Hash(), header.Number.Uint64())
600600
if block == nil {
601-
// This should never happen. In practice, previsouly currentBlock
601+
// This should never happen. In practice, previously currentBlock
602602
// contained the entire block whereas now only a "marker", so there
603603
// is an ever so slight chance for a race we should handle.
604604
log.Error("Current block not found in database", "block", header.Number, "hash", header.Hash())
@@ -982,7 +982,7 @@ func (bc *BlockChain) stopWithoutSaving() {
982982
func (bc *BlockChain) Stop() {
983983
bc.stopWithoutSaving()
984984

985-
// Ensure that the entirety of the state snapshot is journalled to disk.
985+
// Ensure that the entirety of the state snapshot is journaled to disk.
986986
var snapBase common.Hash
987987
if bc.snaps != nil {
988988
var err error
@@ -1193,7 +1193,7 @@ func (bc *BlockChain) InsertReceiptChain(blockChain types.Blocks, receiptChain [
11931193
// a background routine to re-indexed all indices in [ancients - txlookupLimit, ancients)
11941194
// range. In this case, all tx indices of newly imported blocks should be
11951195
// generated.
1196-
var batch = bc.db.NewBatch()
1196+
batch := bc.db.NewBatch()
11971197
for i, block := range blockChain {
11981198
if bc.txLookupLimit == 0 || ancientLimit <= bc.txLookupLimit || block.NumberU64() >= ancientLimit-bc.txLookupLimit {
11991199
rawdb.WriteTxLookupEntriesByBlock(batch, block)
@@ -2585,7 +2585,7 @@ func (bc *BlockChain) SetTrieFlushInterval(interval time.Duration) {
25852585
bc.flushInterval.Store(int64(interval))
25862586
}
25872587

2588-
// GetTrieFlushInterval gets the in-memroy tries flush interval
2588+
// GetTrieFlushInterval gets the in-memory tries flush interval
25892589
func (bc *BlockChain) GetTrieFlushInterval() time.Duration {
25902590
return time.Duration(bc.flushInterval.Load())
25912591
}

eth/catalyst/api.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
560560
log.Warn("Invalid timestamp", "parent", block.Time(), "block", block.Time())
561561
return api.invalid(errors.New("invalid timestamp"), parent.Header()), nil
562562
}
563-
// Another cornercase: if the node is in snap sync mode, but the CL client
563+
// Another corner case: if the node is in snap sync mode, but the CL client
564564
// tries to make it import a block. That should be denied as pushing something
565565
// into the database directly will conflict with the assumptions of snap sync
566566
// that it has an empty db that it can fill itself.
@@ -776,7 +776,7 @@ func (api *ConsensusAPI) ExchangeCapabilities([]string) []string {
776776
// GetPayloadBodiesByHashV1 implements engine_getPayloadBodiesByHashV1 which allows for retrieval of a list
777777
// of block bodies by the engine api.
778778
func (api *ConsensusAPI) GetPayloadBodiesByHashV1(hashes []common.Hash) []*engine.ExecutionPayloadBodyV1 {
779-
var bodies = make([]*engine.ExecutionPayloadBodyV1, len(hashes))
779+
bodies := make([]*engine.ExecutionPayloadBodyV1, len(hashes))
780780
for i, hash := range hashes {
781781
block := api.eth.BlockChain().GetBlockByHash(hash)
782782
bodies[i] = getBody(block)

eth/handler.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ const (
5555
txMaxBroadcastSize = 4096
5656
)
5757

58-
var (
59-
syncChallengeTimeout = 15 * time.Second // Time allowance for a node to reply to the sync progress challenge
60-
)
58+
var syncChallengeTimeout = 15 * time.Second // Time allowance for a node to reply to the sync progress challenge
6159

6260
// txPool defines the methods needed from a transaction pool implementation to
6361
// support all the operations needed by the Ethereum chain protocols.
@@ -89,7 +87,7 @@ type handlerConfig struct {
8987
Chain *core.BlockChain // Blockchain to serve data from
9088
TxPool txPool // Transaction pool to propagate from
9189
Merger *consensus.Merger // The manager for eth1/2 transition
92-
Network uint64 // Network identifier to adfvertise
90+
Network uint64 // Network identifier to advertise
9391
Sync downloader.SyncMode // Whether to snap or full sync
9492
BloomCache uint64 // Megabytes to alloc for snap sync bloom
9593
EventMux *event.TypeMux // Legacy event mux, deprecate for `feed`
@@ -255,7 +253,7 @@ func newHandler(config *handlerConfig) (*handler, error) {
255253
}
256254
td := new(big.Int).Add(ptd, block.Difficulty())
257255
if !h.chain.Config().IsTerminalPoWBlock(ptd, td) {
258-
log.Info("Filtered out non-termimal pow block", "number", block.NumberU64(), "hash", block.Hash())
256+
log.Info("Filtered out non-terminal pow block", "number", block.NumberU64(), "hash", block.Hash())
259257
return 0, nil
260258
}
261259
if err := h.chain.InsertBlockWithoutSetHead(block); err != nil {

0 commit comments

Comments
 (0)