forked from cerc-io/plugeth
all: fix some typos (#25551)
* Fix some typos * Fix some mistakes * Revert 4byte.json * Fix an incorrect fix * Change files to fails
This commit is contained in:
@@ -125,7 +125,7 @@ type SyncingResult struct {
|
||||
Status ethereum.SyncProgress `json:"status"`
|
||||
}
|
||||
|
||||
// uninstallSyncSubscriptionRequest uninstalles a syncing subscription in the API event loop.
|
||||
// uninstallSyncSubscriptionRequest uninstalls a syncing subscription in the API event loop.
|
||||
type uninstallSyncSubscriptionRequest struct {
|
||||
c chan interface{}
|
||||
uninstalled chan interface{}
|
||||
|
||||
@@ -1625,7 +1625,7 @@ func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
|
||||
log.Warn("Invalid header encountered", "number", chunk[n].Number, "hash", chunk[n].Hash(), "parent", chunk[n].ParentHash, "err", err)
|
||||
return fmt.Errorf("%w: %v", errInvalidChain, err)
|
||||
}
|
||||
// All verifications passed, track all headers within the alloted limits
|
||||
// All verifications passed, track all headers within the allotted limits
|
||||
if mode == FastSync {
|
||||
head := chunk[len(chunk)-1].Number.Uint64()
|
||||
if head-rollback > uint64(fsHeaderSafetyNet) {
|
||||
@@ -1663,7 +1663,7 @@ func (d *Downloader) processHeaders(origin uint64, td *big.Int) error {
|
||||
}
|
||||
d.syncStatsLock.Unlock()
|
||||
|
||||
// Signal the content downloaders of the availablility of new tasks
|
||||
// Signal the content downloaders of the availability of new tasks
|
||||
for _, ch := range []chan bool{d.bodyWakeCh, d.receiptWakeCh} {
|
||||
select {
|
||||
case ch <- true:
|
||||
|
||||
@@ -653,8 +653,8 @@ func testForkedSync(t *testing.T, protocol uint, mode SyncMode) {
|
||||
assertOwnForkedChain(t, tester, testChainBase.len(), []int{chainA.len(), chainB.len()})
|
||||
}
|
||||
|
||||
// Tests that synchronising against a much shorter but much heavyer fork works
|
||||
// corrently and is not dropped.
|
||||
// Tests that synchronising against a much shorter but much heavier fork works
|
||||
// correctly and is not dropped.
|
||||
func TestHeavyForkedSync66Full(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, FullSync) }
|
||||
func TestHeavyForkedSync66Fast(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, FastSync) }
|
||||
func TestHeavyForkedSync66Light(t *testing.T) { testHeavyForkedSync(t, eth.ETH66, LightSync) }
|
||||
|
||||
@@ -872,7 +872,7 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header,
|
||||
if res, stale, err := q.resultCache.GetDeliverySlot(header.Number.Uint64()); err == nil {
|
||||
reconstruct(accepted, res)
|
||||
} else {
|
||||
// else: betweeen here and above, some other peer filled this result,
|
||||
// else: between here and above, some other peer filled this result,
|
||||
// or it was indeed a no-op. This should not happen, but if it does it's
|
||||
// not something to panic about
|
||||
log.Error("Delivery stale", "stale", stale, "number", header.Number.Uint64(), "err", err)
|
||||
|
||||
+1
-1
@@ -252,7 +252,7 @@ func (f *lightFetcher) forEachPeer(check func(id enode.ID, p *fetcherPeer) bool)
|
||||
// request will be made for header retrieval.
|
||||
//
|
||||
// - re-sync trigger
|
||||
// If the local chain lags too much, then the fetcher will enter "synnchronise"
|
||||
// If the local chain lags too much, then the fetcher will enter "synchronise"
|
||||
// mode to retrieve missing headers in batch.
|
||||
func (f *lightFetcher) mainloop() {
|
||||
defer f.wg.Done()
|
||||
|
||||
@@ -55,7 +55,7 @@ var (
|
||||
// ClientManager controls the capacity assigned to the clients of a server.
|
||||
// Since ServerParams guarantee a safe lower estimate for processable requests
|
||||
// even in case of all clients being active, ClientManager calculates a
|
||||
// corrigated buffer value and usually allows a higher remaining buffer value
|
||||
// corrugated buffer value and usually allows a higher remaining buffer value
|
||||
// to be returned with each reply.
|
||||
type ClientManager struct {
|
||||
clock mclock.Clock
|
||||
|
||||
+1
-1
@@ -126,7 +126,7 @@ const (
|
||||
// RetrieveTxStatus retrieves the transaction status from the LES network.
|
||||
// There is no guarantee in the LES protocol that the mined transaction will
|
||||
// be retrieved back for sure because of different reasons(the transaction
|
||||
// is unindexed, the malicous server doesn't reply it deliberately, etc).
|
||||
// is unindexed, the malicious server doesn't reply it deliberately, etc).
|
||||
// Therefore, unretrieved transactions(UNKNOWN) will receive a certain number
|
||||
// of retries, thus giving a weak guarantee.
|
||||
func (odr *LesOdr) RetrieveTxStatus(ctx context.Context, req *light.TxStatusRequest) error {
|
||||
|
||||
@@ -104,7 +104,7 @@ func TestFillSet(t *testing.T) {
|
||||
fs.SetTarget(10)
|
||||
expWaiting(4, true)
|
||||
expNotWaiting()
|
||||
// remove all previosly set flags
|
||||
// remove all previously set flags
|
||||
ns.ForEach(sfTest1, nodestate.Flags{}, func(node *enode.Node, state nodestate.Flags) {
|
||||
ns.SetState(node, nodestate.Flags{}, sfTest1, 0)
|
||||
})
|
||||
|
||||
@@ -66,7 +66,7 @@ type ServerPoolTest struct {
|
||||
// (accessed from both the main thread and the preNeg callback)
|
||||
preNegLock sync.Mutex
|
||||
queryWg *sync.WaitGroup // a new wait group is created each time the simulation is started
|
||||
stopping bool // stopping avoid callind queryWg.Add after queryWg.Wait
|
||||
stopping bool // stopping avoid calling queryWg.Add after queryWg.Wait
|
||||
|
||||
cycle, conn, servedConn int
|
||||
serviceCycles, dialCount int
|
||||
|
||||
@@ -623,7 +623,7 @@ func (n *nodeBalance) priorityToBalance(priority int64, capacity uint64) (uint64
|
||||
return 0, uint64(-priority)
|
||||
}
|
||||
|
||||
// reducedBalance estimates the reduced balance at a given time in the fututre based
|
||||
// reducedBalance estimates the reduced balance at a given time in the future based
|
||||
// on the given balance, the time factor and an estimated average request cost per time ratio
|
||||
func (n *nodeBalance) reducedBalance(b balance, start mclock.AbsTime, dt time.Duration, capacity uint64, avgReqCost float64) balance {
|
||||
// since the costs are applied continuously during the dt time period we calculate
|
||||
|
||||
@@ -54,7 +54,7 @@ func newBalanceTestSetup(db ethdb.KeyValueStore, posExp, negExp utils.ValueExpir
|
||||
// Initialize and customize the setup for the balance testing
|
||||
clock := &mclock.Simulated{}
|
||||
setup := newServerSetup()
|
||||
setup.clientField = setup.setup.NewField("balancTestClient", reflect.TypeOf(balanceTestClient{}))
|
||||
setup.clientField = setup.setup.NewField("balanceTestClient", reflect.TypeOf(balanceTestClient{}))
|
||||
|
||||
ns := nodestate.NewNodeStateMachine(nil, nil, clock, setup.setup)
|
||||
if posExp == nil {
|
||||
@@ -298,7 +298,7 @@ func TestEstimatedPriority(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPostiveBalanceCounting(t *testing.T) {
|
||||
func TestPositiveBalanceCounting(t *testing.T) {
|
||||
b := newBalanceTestSetup(nil, nil, nil)
|
||||
defer b.stop()
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ type serverSetup struct {
|
||||
activeFlag nodestate.Flags // Flag is set if the node is active
|
||||
inactiveFlag nodestate.Flags // Flag is set if the node is inactive
|
||||
capacityField nodestate.Field // Field contains the capacity of the node
|
||||
queueField nodestate.Field // Field contains the infomration in the priority queue
|
||||
queueField nodestate.Field // Field contains the information in the priority queue
|
||||
}
|
||||
|
||||
// newServerSetup initializes the setup for state machine and returns the flags/fields group.
|
||||
|
||||
Reference in New Issue
Block a user