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:
@@ -36,7 +36,7 @@ type blockPropagation struct {
|
||||
td *big.Int
|
||||
}
|
||||
|
||||
// broadcastBlocks is a write loop that multiplexes blocks and block accouncements
|
||||
// broadcastBlocks is a write loop that multiplexes blocks and block announcements
|
||||
// to the remote peer. The goal is to have an async writer that does not lock up
|
||||
// node internals and at the same time rate limits queued data.
|
||||
func (p *Peer) broadcastBlocks() {
|
||||
|
||||
@@ -224,7 +224,7 @@ func (p *Peer) dispatcher() {
|
||||
switch {
|
||||
case res.Req == nil:
|
||||
// Response arrived with an untracked ID. Since even cancelled
|
||||
// requests are tracked until fulfilment, a dangling repsponse
|
||||
// requests are tracked until fulfilment, a dangling response
|
||||
// means the remote peer implements the protocol badly.
|
||||
resOp.fail <- errDanglingResponse
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ func (b *testBackend) Chain() *core.BlockChain { return b.chain }
|
||||
func (b *testBackend) TxPool() TxPool { return b.txpool }
|
||||
|
||||
func (b *testBackend) RunPeer(peer *Peer, handler Handler) error {
|
||||
// Normally the backend would do peer mainentance and handshakes. All that
|
||||
// Normally the backend would do peer maintenance and handshakes. All that
|
||||
// is omitted and we will just give control back to the handler.
|
||||
return handler(peer)
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ func (p *Peer) ID() string {
|
||||
return p.id
|
||||
}
|
||||
|
||||
// Version retrieves the peer's negoatiated `eth` protocol version.
|
||||
// Version retrieves the peer's negotiated `eth` protocol version.
|
||||
func (p *Peer) Version() uint {
|
||||
return p.version
|
||||
}
|
||||
|
||||
@@ -504,7 +504,7 @@ func ServiceGetTrieNodesQuery(chain *core.BlockChain, req *GetTrieNodesPacket, s
|
||||
var (
|
||||
nodes [][]byte
|
||||
bytes uint64
|
||||
loads int // Trie hash expansions to cound database reads
|
||||
loads int // Trie hash expansions to count database reads
|
||||
)
|
||||
for _, pathset := range req.Paths {
|
||||
switch len(pathset) {
|
||||
|
||||
@@ -61,12 +61,12 @@ func (p *Peer) ID() string {
|
||||
return p.id
|
||||
}
|
||||
|
||||
// Version retrieves the peer's negoatiated `snap` protocol version.
|
||||
// Version retrieves the peer's negotiated `snap` protocol version.
|
||||
func (p *Peer) Version() uint {
|
||||
return p.version
|
||||
}
|
||||
|
||||
// Log overrides the P2P logget with the higher level one containing only the id.
|
||||
// Log overrides the P2P logger with the higher level one containing only the id.
|
||||
func (p *Peer) Log() log.Logger {
|
||||
return p.logger
|
||||
}
|
||||
@@ -87,7 +87,7 @@ func (p *Peer) RequestAccountRange(id uint64, root common.Hash, origin, limit co
|
||||
}
|
||||
|
||||
// RequestStorageRange fetches a batch of storage slots belonging to one or more
|
||||
// accounts. If slots from only one accout is requested, an origin marker may also
|
||||
// accounts. If slots from only one account is requested, an origin marker may also
|
||||
// be used to retrieve from there.
|
||||
func (p *Peer) RequestStorageRanges(id uint64, root common.Hash, accounts []common.Hash, origin, limit []byte, bytes uint64) error {
|
||||
if len(accounts) == 1 && origin != nil {
|
||||
@@ -119,7 +119,7 @@ func (p *Peer) RequestByteCodes(id uint64, hashes []common.Hash, bytes uint64) e
|
||||
}
|
||||
|
||||
// RequestTrieNodes fetches a batch of account or storage trie nodes rooted in
|
||||
// a specificstate trie.
|
||||
// a specific state trie.
|
||||
func (p *Peer) RequestTrieNodes(id uint64, root common.Hash, paths []TrieNodePathSet, bytes uint64) error {
|
||||
p.logger.Trace("Fetching set of trie nodes", "reqid", id, "root", root, "pathsets", len(paths), "bytes", common.StorageSize(bytes))
|
||||
|
||||
|
||||
+13
-13
@@ -365,7 +365,7 @@ type SyncPeer interface {
|
||||
RequestAccountRange(id uint64, root, origin, limit common.Hash, bytes uint64) error
|
||||
|
||||
// RequestStorageRanges fetches a batch of storage slots belonging to one or
|
||||
// more accounts. If slots from only one accout is requested, an origin marker
|
||||
// more accounts. If slots from only one account is requested, an origin marker
|
||||
// may also be used to retrieve from there.
|
||||
RequestStorageRanges(id uint64, root common.Hash, accounts []common.Hash, origin, limit []byte, bytes uint64) error
|
||||
|
||||
@@ -373,7 +373,7 @@ type SyncPeer interface {
|
||||
RequestByteCodes(id uint64, hashes []common.Hash, bytes uint64) error
|
||||
|
||||
// RequestTrieNodes fetches a batch of account or storage trie nodes rooted in
|
||||
// a specificstate trie.
|
||||
// a specific state trie.
|
||||
RequestTrieNodes(id uint64, root common.Hash, paths []TrieNodePathSet, bytes uint64) error
|
||||
|
||||
// Log retrieves the peer's own contextual logger.
|
||||
@@ -1183,10 +1183,10 @@ func (s *Syncer) assignStorageTasks(success chan *storageResponse, fail chan *st
|
||||
}
|
||||
if subtask == nil {
|
||||
// No large contract required retrieval, but small ones available
|
||||
for acccount, root := range task.stateTasks {
|
||||
delete(task.stateTasks, acccount)
|
||||
for account, root := range task.stateTasks {
|
||||
delete(task.stateTasks, account)
|
||||
|
||||
accounts = append(accounts, acccount)
|
||||
accounts = append(accounts, account)
|
||||
roots = append(roots, root)
|
||||
|
||||
if len(accounts) >= storageSets {
|
||||
@@ -1486,7 +1486,7 @@ func (s *Syncer) assignBytecodeHealTasks(success chan *bytecodeHealResponse, fai
|
||||
}
|
||||
}
|
||||
|
||||
// revertRequests locates all the currently pending reuqests from a particular
|
||||
// revertRequests locates all the currently pending requests from a particular
|
||||
// peer and reverts them, rescheduling for others to fulfill.
|
||||
func (s *Syncer) revertRequests(peer string) {
|
||||
// Gather the requests first, revertals need the lock too
|
||||
@@ -1575,7 +1575,7 @@ func (s *Syncer) revertAccountRequest(req *accountRequest) {
|
||||
s.lock.Unlock()
|
||||
|
||||
// If there's a timeout timer still running, abort it and mark the account
|
||||
// task as not-pending, ready for resheduling
|
||||
// task as not-pending, ready for rescheduling
|
||||
req.timeout.Stop()
|
||||
if req.task.req == req {
|
||||
req.task.req = nil
|
||||
@@ -1616,7 +1616,7 @@ func (s *Syncer) revertBytecodeRequest(req *bytecodeRequest) {
|
||||
s.lock.Unlock()
|
||||
|
||||
// If there's a timeout timer still running, abort it and mark the code
|
||||
// retrievals as not-pending, ready for resheduling
|
||||
// retrievals as not-pending, ready for rescheduling
|
||||
req.timeout.Stop()
|
||||
for _, hash := range req.hashes {
|
||||
req.task.codeTasks[hash] = struct{}{}
|
||||
@@ -1657,7 +1657,7 @@ func (s *Syncer) revertStorageRequest(req *storageRequest) {
|
||||
s.lock.Unlock()
|
||||
|
||||
// If there's a timeout timer still running, abort it and mark the storage
|
||||
// task as not-pending, ready for resheduling
|
||||
// task as not-pending, ready for rescheduling
|
||||
req.timeout.Stop()
|
||||
if req.subTask != nil {
|
||||
req.subTask.req = nil
|
||||
@@ -1743,7 +1743,7 @@ func (s *Syncer) revertBytecodeHealRequest(req *bytecodeHealRequest) {
|
||||
s.lock.Unlock()
|
||||
|
||||
// If there's a timeout timer still running, abort it and mark the code
|
||||
// retrievals as not-pending, ready for resheduling
|
||||
// retrievals as not-pending, ready for rescheduling
|
||||
req.timeout.Stop()
|
||||
for _, hash := range req.hashes {
|
||||
req.task.codeTasks[hash] = struct{}{}
|
||||
@@ -2035,7 +2035,7 @@ func (s *Syncer) processStorageResponse(res *storageResponse) {
|
||||
}
|
||||
tr.Commit()
|
||||
}
|
||||
// Persist the received storage segements. These flat state maybe
|
||||
// Persist the received storage segments. These flat state maybe
|
||||
// outdated during the sync, but it can be fixed later during the
|
||||
// snapshot generation.
|
||||
for j := 0; j < len(res.hashes[i]); j++ {
|
||||
@@ -2170,7 +2170,7 @@ func (s *Syncer) forwardAccountTask(task *accountTask) {
|
||||
}
|
||||
task.res = nil
|
||||
|
||||
// Persist the received account segements. These flat state maybe
|
||||
// Persist the received account segments. These flat state maybe
|
||||
// outdated during the sync, but it can be fixed later during the
|
||||
// snapshot generation.
|
||||
oldAccountBytes := s.accountBytes
|
||||
@@ -2773,7 +2773,7 @@ func (s *Syncer) onHealByteCodes(peer SyncPeer, id uint64, bytecodes [][]byte) e
|
||||
}
|
||||
|
||||
// onHealState is a callback method to invoke when a flat state(account
|
||||
// or storage slot) is downloded during the healing stage. The flat states
|
||||
// or storage slot) is downloaded during the healing stage. The flat states
|
||||
// can be persisted blindly and can be fixed later in the generation stage.
|
||||
// Note it's not concurrent safe, please handle the concurrent issue outside.
|
||||
func (s *Syncer) onHealState(paths [][]byte, value []byte) error {
|
||||
|
||||
Reference in New Issue
Block a user