all: fix spelling mistakes (#25961)
This commit is contained in:
+1
-1
@@ -105,7 +105,7 @@ type ConsensusAPI struct {
|
||||
// problematic, so we will only track the head chain segment of a bad
|
||||
// chain to allow discarding progressing bad chains and side chains,
|
||||
// without tracking too much bad data.
|
||||
invalidBlocksHits map[common.Hash]int // Emhemeral cache to track invalid blocks and their hit count
|
||||
invalidBlocksHits map[common.Hash]int // Ephemeral cache to track invalid blocks and their hit count
|
||||
invalidTipsets map[common.Hash]*types.Header // Ephemeral cache to track invalid tipsets and their bad ancestor
|
||||
invalidLock sync.Mutex // Protects the invalid maps from concurrent access
|
||||
|
||||
|
||||
@@ -632,7 +632,7 @@ func (q *queue) ExpireReceipts(peer string) int {
|
||||
// lock is not obtained in here is that the parameters already need to access
|
||||
// the queue, so they already need a lock anyway.
|
||||
func (q *queue) expire(peer string, pendPool map[string]*fetchRequest, taskQueue *prque.Prque) int {
|
||||
// Retrieve the request being expired and log an error if it's non-existnet,
|
||||
// Retrieve the request being expired and log an error if it's non-existent,
|
||||
// as there's no order of events that should lead to such expirations.
|
||||
req := pendPool[peer]
|
||||
if req == nil {
|
||||
|
||||
@@ -35,7 +35,7 @@ import (
|
||||
// scratchHeaders is the number of headers to store in a scratch space to allow
|
||||
// concurrent downloads. A header is about 0.5KB in size, so there is no worry
|
||||
// about using too much memory. The only catch is that we can only validate gaps
|
||||
// afer they're linked to the head, so the bigger the scratch space, the larger
|
||||
// after they're linked to the head, so the bigger the scratch space, the larger
|
||||
// potential for invalid headers.
|
||||
//
|
||||
// The current scratch space of 131072 headers is expected to use 64MB RAM.
|
||||
|
||||
@@ -154,7 +154,7 @@ type TxFetcher struct {
|
||||
// broadcast without needing explicit request/reply round trips.
|
||||
waitlist map[common.Hash]map[string]struct{} // Transactions waiting for an potential broadcast
|
||||
waittime map[common.Hash]mclock.AbsTime // Timestamps when transactions were added to the waitlist
|
||||
waitslots map[string]map[common.Hash]struct{} // Waiting announcement sgroupped by peer (DoS protection)
|
||||
waitslots map[string]map[common.Hash]struct{} // Waiting announcements grouped by peer (DoS protection)
|
||||
|
||||
// Stage 2: Queue of transactions that waiting to be allocated to some peer
|
||||
// to be retrieved directly.
|
||||
@@ -218,7 +218,7 @@ func (f *TxFetcher) Notify(peer string, hashes []common.Hash) error {
|
||||
txAnnounceInMeter.Mark(int64(len(hashes)))
|
||||
|
||||
// Skip any transaction announcements that we already know of, or that we've
|
||||
// previously marked as cheap and discarded. This check is of course racey,
|
||||
// previously marked as cheap and discarded. This check is of course racy,
|
||||
// because multiple concurrent notifies will still manage to pass it, but it's
|
||||
// still valuable to check here because it runs concurrent to the internal
|
||||
// loop, so anything caught here is time saved internally.
|
||||
|
||||
@@ -203,7 +203,7 @@ func (p *Peer) dispatcher() {
|
||||
}
|
||||
|
||||
case cancelOp := <-p.reqCancel:
|
||||
// Retrieve the pendign request to cancel and short circuit if it
|
||||
// Retrieve the pending request to cancel and short circuit if it
|
||||
// has already been serviced and is not available anymore
|
||||
req := pending[cancelOp.id]
|
||||
if req == nil {
|
||||
|
||||
@@ -335,7 +335,7 @@ func testGetBlockBodies(t *testing.T, protocol uint) {
|
||||
}
|
||||
// Run each of the tests and verify the results against the chain
|
||||
for i, tt := range tests {
|
||||
// Collect the hashes to request, and the response to expectva
|
||||
// Collect the hashes to request, and the response to expect
|
||||
var (
|
||||
hashes []common.Hash
|
||||
bodies []*BlockBody
|
||||
|
||||
@@ -188,7 +188,7 @@ func (p *Peer) markTransaction(hash common.Hash) {
|
||||
// not be managed directly.
|
||||
//
|
||||
// The reasons this is public is to allow packages using this protocol to write
|
||||
// tests that directly send messages without having to do the asyn queueing.
|
||||
// tests that directly send messages without having to do the async queueing.
|
||||
func (p *Peer) SendTransactions(txs types.Transactions) error {
|
||||
// Mark all the transactions as known, but ensure we don't overflow our limits
|
||||
for _, tx := range txs {
|
||||
|
||||
@@ -139,7 +139,7 @@ func HandleMessage(backend Backend, peer *Peer) error {
|
||||
}
|
||||
defer msg.Discard()
|
||||
start := time.Now()
|
||||
// Track the emount of time it takes to serve the request and run the handler
|
||||
// Track the amount of time it takes to serve the request and run the handler
|
||||
if metrics.Enabled {
|
||||
h := fmt.Sprintf("%s/%s/%d/%#02x", p2p.HandleHistName, ProtocolName, peer.Version(), msg.Code)
|
||||
defer func(start time.Time) {
|
||||
@@ -343,7 +343,7 @@ func ServiceGetStorageRangesQuery(chain *core.BlockChain, req *GetStorageRangesP
|
||||
req.Bytes = softResponseLimit
|
||||
}
|
||||
// TODO(karalabe): Do we want to enforce > 0 accounts and 1 account if origin is set?
|
||||
// TODO(karalabe): - Logging locally is not ideal as remote faulst annoy the local user
|
||||
// TODO(karalabe): - Logging locally is not ideal as remote faults annoy the local user
|
||||
// TODO(karalabe): - Dropping the remote peer is less flexible wrt client bugs (slow is better than non-functional)
|
||||
|
||||
// Calculate the hard limit at which to abort, even if mid storage trie
|
||||
|
||||
@@ -95,7 +95,7 @@ func TestHashRanges(t *testing.T) {
|
||||
// meaningful space size for manual verification.
|
||||
// - The head being 0xff...f0, we have 14 hashes left in the space
|
||||
// - Chunking up 14 into 3 pieces is 4.(6), but we need the ceil of 5 to avoid a micro-last-chunk
|
||||
// - Since the range is not divisible, the last interval will be shrter, capped at 0xff...f
|
||||
// - Since the range is not divisible, the last interval will be shorter, capped at 0xff...f
|
||||
// - The chunk ranges thus needs to be [..0, ..5], [..6, ..b], [..c, ..f]
|
||||
{
|
||||
head: common.HexToHash("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"),
|
||||
|
||||
@@ -70,7 +70,7 @@ const (
|
||||
// and waste round trip times. If it's too high, we're capping responses and
|
||||
// waste bandwidth.
|
||||
//
|
||||
// Depoyed bytecodes are currently capped at 24KB, so the minimum request
|
||||
// Deployed bytecodes are currently capped at 24KB, so the minimum request
|
||||
// size should be maxRequestSize / 24K. Assuming that most contracts do not
|
||||
// come close to that, requesting 4x should be a good approximation.
|
||||
maxCodeRequestCount = maxRequestSize / (24 * 1024) * 4
|
||||
@@ -87,8 +87,8 @@ const (
|
||||
trienodeHealRateMeasurementImpact = 0.005
|
||||
|
||||
// minTrienodeHealThrottle is the minimum divisor for throttling trie node
|
||||
// heal requests to avoid overloading the local node and exessively expanding
|
||||
// the state trie bedth wise.
|
||||
// heal requests to avoid overloading the local node and excessively expanding
|
||||
// the state trie breadth wise.
|
||||
minTrienodeHealThrottle = 1
|
||||
|
||||
// maxTrienodeHealThrottle is the maximum divisor for throttling trie node
|
||||
|
||||
@@ -138,7 +138,7 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) {
|
||||
if _, err = st.TransitionDb(); err != nil {
|
||||
t.Fatalf("failed to execute transaction: %v", err)
|
||||
}
|
||||
// Retrieve the trace result and compare against the etalon
|
||||
// Retrieve the trace result and compare against the expected.
|
||||
res, err := tracer.GetResult()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to retrieve trace result: %v", err)
|
||||
|
||||
@@ -122,7 +122,7 @@ func testPrestateDiffTracer(tracerName string, dirPath string, t *testing.T, typ
|
||||
if _, err = st.TransitionDb(); err != nil {
|
||||
t.Fatalf("failed to execute transaction: %v", err)
|
||||
}
|
||||
// Retrieve the trace result and compare against the etalon
|
||||
// Retrieve the trace result and compare against the expected
|
||||
res, err := tracer.GetResult()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to retrieve trace result: %v", err)
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
// Force-load native and js pacakges, to trigger registration
|
||||
// Force-load native and js packages, to trigger registration
|
||||
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
|
||||
_ "github.com/ethereum/go-ethereum/eth/tracers/native"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user