Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
Geth-Modification
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张蕾
Geth-Modification
Commits
5a02b2d6
Unverified
Commit
5a02b2d6
authored
2 years ago
by
Martin Holst Swende
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: fix spelling mistakes (#25961)
parent
7eafbec7
Changes
49
Hide whitespace changes
Inline
Side-by-side
Showing
49 changed files
with
64 additions
and
64 deletions
+64
-64
manager.go
accounts/manager.go
+1
-1
snap.go
cmd/devp2p/internal/ethtest/snap.go
+1
-1
transition.go
cmd/evm/internal/t8ntool/transition.go
+1
-1
snapshot_test.go
consensus/clique/snapshot_test.go
+1
-1
matcher.go
core/bloombits/matcher.go
+1
-1
dump.go
core/state/dump.go
+1
-1
conversion.go
core/state/snapshot/conversion.go
+1
-1
iterator_fast.go
core/state/snapshot/iterator_fast.go
+1
-1
iterator_test.go
core/state/snapshot/iterator_test.go
+1
-1
metrics.go
core/state/snapshot/metrics.go
+1
-1
snapshot_test.go
core/state/snapshot/snapshot_test.go
+2
-2
statedb.go
core/state/statedb.go
+3
-3
tx_list.go
core/tx_list.go
+1
-1
tx_pool.go
core/tx_pool.go
+2
-2
tx_pool_test.go
core/tx_pool_test.go
+1
-1
contracts.go
core/vm/contracts.go
+1
-1
signature_cgo.go
crypto/signature_cgo.go
+1
-1
api.go
eth/catalyst/api.go
+1
-1
queue.go
eth/downloader/queue.go
+1
-1
skeleton.go
eth/downloader/skeleton.go
+1
-1
tx_fetcher.go
eth/fetcher/tx_fetcher.go
+2
-2
dispatcher.go
eth/protocols/eth/dispatcher.go
+1
-1
handler_test.go
eth/protocols/eth/handler_test.go
+1
-1
peer.go
eth/protocols/eth/peer.go
+1
-1
handler.go
eth/protocols/snap/handler.go
+2
-2
range_test.go
eth/protocols/snap/range_test.go
+1
-1
sync.go
eth/protocols/snap/sync.go
+3
-3
calltrace_test.go
eth/tracers/internal/tracetest/calltrace_test.go
+1
-1
prestate_test.go
eth/tracers/internal/tracetest/prestate_test.go
+1
-1
util.go
eth/tracers/internal/tracetest/util.go
+1
-1
ethclient_test.go
ethclient/ethclient_test.go
+1
-1
api.go
internal/ethapi/api.go
+2
-2
version.go
internal/version/version.go
+1
-1
resultstore.go
les/downloader/resultstore.go
+1
-1
fetcher_test.go
les/fetcher_test.go
+1
-1
manager.go
les/flowcontrol/manager.go
+1
-1
odr.go
les/odr.go
+1
-1
server_requests.go
les/server_requests.go
+1
-1
clientpool.go
les/vflux/server/clientpool.go
+1
-1
txpool.go
light/txpool.go
+1
-1
main.go
miner/stress/1559/main.go
+1
-1
interface.go
mobile/interface.go
+1
-1
msgrate.go
p2p/msgrate/msgrate.go
+5
-5
api.go
signer/core/api.go
+2
-2
rangeproof-fuzzer.go
tests/fuzzers/rangeproof/rangeproof-fuzzer.go
+1
-1
runtime_fuzz.go
tests/fuzzers/runtime/runtime_fuzz.go
+1
-1
proof.go
trie/proof.go
+1
-1
stacktrie.go
trie/stacktrie.go
+1
-1
trie_test.go
trie/trie_test.go
+2
-2
No files found.
accounts/manager.go
View file @
5a02b2d6
...
...
@@ -257,7 +257,7 @@ func merge(slice []Wallet, wallets ...Wallet) []Wallet {
return
slice
}
// drop is the couterpart of merge, which looks up wallets from within the sorted
// drop is the cou
n
terpart of merge, which looks up wallets from within the sorted
// cache and removes the ones specified.
func
drop
(
slice
[]
Wallet
,
wallets
...
Wallet
)
[]
Wallet
{
for
_
,
wallet
:=
range
wallets
{
...
...
This diff is collapsed.
Click to expand it.
cmd/devp2p/internal/ethtest/snap.go
View file @
5a02b2d6
...
...
@@ -90,7 +90,7 @@ func (s *Suite) TestSnapGetAccountRange(t *utesting.T) {
{
4000
,
s
.
chain
.
RootAt
(
0
),
zero
,
ffHash
,
0
,
zero
,
zero
},
// A 127 block old stateroot, expected to be served
{
4000
,
s
.
chain
.
RootAt
(
999
-
127
),
zero
,
ffHash
,
77
,
firstKey
,
common
.
HexToHash
(
"0xe4c6fdef5dd4e789a2612390806ee840b8ec0fe52548f8b4efe41abb20c37aac"
)},
// A root which is not actually an account root, but a storage
or
ot
// A root which is not actually an account root, but a storage
ro
ot
{
4000
,
storageRoot
,
zero
,
ffHash
,
0
,
zero
,
zero
},
// And some non-sensical requests
...
...
This diff is collapsed.
Click to expand it.
cmd/evm/internal/t8ntool/transition.go
View file @
5a02b2d6
...
...
@@ -394,7 +394,7 @@ func (g Alloc) OnAccount(addr common.Address, dumpAccount state.DumpAccount) {
g
[
addr
]
=
genesisAccount
}
// saveFile marshal
l
s the object to the given file
// saveFile marshals the object to the given file
func
saveFile
(
baseDir
,
filename
string
,
data
interface
{})
error
{
b
,
err
:=
json
.
MarshalIndent
(
data
,
""
,
" "
)
if
err
!=
nil
{
...
...
This diff is collapsed.
Click to expand it.
consensus/clique/snapshot_test.go
View file @
5a02b2d6
...
...
@@ -86,7 +86,7 @@ func (ap *testerAccountPool) sign(header *types.Header, signer string) {
copy
(
header
.
Extra
[
len
(
header
.
Extra
)
-
extraSeal
:
],
sig
)
}
// testerVote represents a single block signed by a par
cit
ular account, where
// testerVote represents a single block signed by a par
tic
ular account, where
// the account may or may not have cast a Clique vote.
type
testerVote
struct
{
signer
string
...
...
This diff is collapsed.
Click to expand it.
core/bloombits/matcher.go
View file @
5a02b2d6
...
...
@@ -612,7 +612,7 @@ func (s *MatcherSession) Multiplex(batch int, wait time.Duration, mux chan chan
return
case
<-
time
.
After
(
wait
)
:
// Throttling up, fetch whatever
'
s available
// Throttling up, fetch whatever
i
s available
}
}
// Allocate as much as we can handle and request servicing
...
...
This diff is collapsed.
Click to expand it.
core/state/dump.go
View file @
5a02b2d6
...
...
@@ -29,7 +29,7 @@ import (
"github.com/ethereum/go-ethereum/trie"
)
// DumpConfig is a set of options to control what portions of the statewill be
// DumpConfig is a set of options to control what portions of the state
will be
// iterated and collected.
type
DumpConfig
struct
{
SkipCode
bool
...
...
This diff is collapsed.
Click to expand it.
core/state/snapshot/conversion.go
View file @
5a02b2d6
...
...
@@ -136,7 +136,7 @@ func (stat *generateStats) progressAccounts(account common.Hash, done uint64) {
stat
.
head
=
account
}
// finishAccounts updates the ge
m
erator stats for the finished account range.
// finishAccounts updates the ge
n
erator stats for the finished account range.
func
(
stat
*
generateStats
)
finishAccounts
(
done
uint64
)
{
stat
.
lock
.
Lock
()
defer
stat
.
lock
.
Unlock
()
...
...
This diff is collapsed.
Click to expand it.
core/state/snapshot/iterator_fast.go
View file @
5a02b2d6
...
...
@@ -276,7 +276,7 @@ func (fi *fastIterator) next(idx int) bool {
return
false
}
// The elem we're placing it next to has the same value,
// so whichever winds up on n+1 will need further iteraton
// so whichever winds up on n+1 will need further iterat
i
on
clash
=
n
+
1
return
cur
.
priority
<
fi
.
iterators
[
n
+
1
]
.
priority
...
...
This diff is collapsed.
Click to expand it.
core/state/snapshot/iterator_test.go
View file @
5a02b2d6
...
...
@@ -819,7 +819,7 @@ func TestStorageIteratorDeletions(t *testing.T) {
// only spit out 200 values eventually.
//
// The value-fetching benchmark is easy on the binary iterator, since it never has to reach
// down at any depth for retrieving the values -- all are on the top
p
most layer
// down at any depth for retrieving the values -- all are on the topmost layer
//
// BenchmarkAccountIteratorTraversal/binary_iterator_keys-6 2239 483674 ns/op
// BenchmarkAccountIteratorTraversal/binary_iterator_values-6 2403 501810 ns/op
...
...
This diff is collapsed.
Click to expand it.
core/state/snapshot/metrics.go
View file @
5a02b2d6
...
...
@@ -36,7 +36,7 @@ var (
snapAccountProveCounter
=
metrics
.
NewRegisteredCounter
(
"state/snapshot/generation/duration/account/prove"
,
nil
)
// snapAccountTrieReadCounter measures time spent on the account trie iteration
snapAccountTrieReadCounter
=
metrics
.
NewRegisteredCounter
(
"state/snapshot/generation/duration/account/trieread"
,
nil
)
// snapAccountSnapReadCounter measues time spent on the snapshot account iteration
// snapAccountSnapReadCounter measu
r
es time spent on the snapshot account iteration
snapAccountSnapReadCounter
=
metrics
.
NewRegisteredCounter
(
"state/snapshot/generation/duration/account/snapread"
,
nil
)
// snapAccountWriteCounter measures time spent on writing/updating/deleting accounts
snapAccountWriteCounter
=
metrics
.
NewRegisteredCounter
(
"state/snapshot/generation/duration/account/write"
,
nil
)
...
...
This diff is collapsed.
Click to expand it.
core/state/snapshot/snapshot_test.go
View file @
5a02b2d6
...
...
@@ -166,7 +166,7 @@ func TestDiskLayerExternalInvalidationPartialFlatten(t *testing.T) {
if
err
:=
snaps
.
Cap
(
common
.
HexToHash
(
"0x03"
),
1
);
err
!=
nil
{
t
.
Fatalf
(
"failed to merge accumulator onto disk: %v"
,
err
)
}
// Since the base layer was modified, ensure that data retrieval
d
on the external reference fail
// Since the base layer was modified, ensure that data retrieval
s
on the external reference fail
if
acc
,
err
:=
ref
.
Account
(
common
.
HexToHash
(
"0x01"
));
err
!=
ErrSnapshotStale
{
t
.
Errorf
(
"stale reference returned account: %#x (err: %v)"
,
acc
,
err
)
}
...
...
@@ -224,7 +224,7 @@ func TestDiffLayerExternalInvalidationPartialFlatten(t *testing.T) {
if
err
:=
snaps
.
Cap
(
common
.
HexToHash
(
"0x04"
),
1
);
err
!=
nil
{
t
.
Fatalf
(
"failed to flatten diff layer into accumulator: %v"
,
err
)
}
// Since the accumulator diff layer was modified, ensure that data retrieval
d
on the external reference fail
// Since the accumulator diff layer was modified, ensure that data retrieval
s
on the external reference fail
if
acc
,
err
:=
ref
.
Account
(
common
.
HexToHash
(
"0x01"
));
err
!=
ErrSnapshotStale
{
t
.
Errorf
(
"stale reference returned account: %#x (err: %v)"
,
acc
,
err
)
}
...
...
This diff is collapsed.
Click to expand it.
core/state/statedb.go
View file @
5a02b2d6
...
...
@@ -667,7 +667,7 @@ func (s *StateDB) Copy() *StateDB {
// nil
if
object
,
exist
:=
s
.
stateObjects
[
addr
];
exist
{
// Even though the original object is dirty, we are not copying the journal,
// so we need to make sure that any
side
effect the journal would have caused
// so we need to make sure that any
side-
effect the journal would have caused
// during a commit (or similar op) is already applied to the copy.
state
.
stateObjects
[
addr
]
=
object
.
deepCopy
(
state
)
...
...
@@ -796,8 +796,8 @@ func (s *StateDB) Finalise(deleteEmptyObjects bool) {
// resurrect an account; but the snapshotter needs both events.
if
s
.
snap
!=
nil
{
s
.
snapDestructs
[
obj
.
addrHash
]
=
struct
{}{}
// We need to maintain account deletions explicitly (will remain set indefinitely)
delete
(
s
.
snapAccounts
,
obj
.
addrHash
)
// Clear out any previously updated account data (may be recreated via a res
s
urrect)
delete
(
s
.
snapStorage
,
obj
.
addrHash
)
// Clear out any previously updated storage data (may be recreated via a res
s
urrect)
delete
(
s
.
snapAccounts
,
obj
.
addrHash
)
// Clear out any previously updated account data (may be recreated via a resurrect)
delete
(
s
.
snapStorage
,
obj
.
addrHash
)
// Clear out any previously updated storage data (may be recreated via a resurrect)
}
}
else
{
obj
.
finalise
(
true
)
// Prefetch slots in the background
...
...
This diff is collapsed.
Click to expand it.
core/tx_list.go
View file @
5a02b2d6
...
...
@@ -469,7 +469,7 @@ func (h *priceHeap) Pop() interface{} {
}
// txPricedList is a price-sorted heap to allow operating on transactions pool
// contents in a price-incrementing way. It's built
o
pon the all transactions
// contents in a price-incrementing way. It's built
u
pon the all transactions
// in txpool but only interested in the remote part. It means only remote transactions
// will be considered for tracking, sorting, eviction, etc.
//
...
...
This diff is collapsed.
Click to expand it.
core/tx_pool.go
View file @
5a02b2d6
...
...
@@ -65,7 +65,7 @@ var (
// configured for the transaction pool.
ErrUnderpriced
=
errors
.
New
(
"transaction underpriced"
)
// ErrTxPoolOverflow is returned if the transaction pool is full and can't acc
pe
t
// ErrTxPoolOverflow is returned if the transaction pool is full and can't acc
ep
t
// another remote transaction.
ErrTxPoolOverflow
=
errors
.
New
(
"txpool is full"
)
...
...
@@ -850,7 +850,7 @@ func (pool *TxPool) AddLocals(txs []*types.Transaction) []error {
}
// AddLocal enqueues a single local transaction into the pool if it is valid. This is
// a convenience wrapper around
d
AddLocals.
// a convenience wrapper around AddLocals.
func
(
pool
*
TxPool
)
AddLocal
(
tx
*
types
.
Transaction
)
error
{
errs
:=
pool
.
AddLocals
([]
*
types
.
Transaction
{
tx
})
return
errs
[
0
]
...
...
This diff is collapsed.
Click to expand it.
core/tx_pool_test.go
View file @
5a02b2d6
...
...
@@ -2158,7 +2158,7 @@ func TestTransactionReplacementDynamicFee(t *testing.T) {
stages
:=
[]
string
{
"pending"
,
"queued"
}
for
_
,
stage
:=
range
stages
{
// Since state is empty, 0 nonce txs are "executable" and can go
// into pending immediately. 2 nonce txs are "
happed
// into pending immediately. 2 nonce txs are "
gapped"
nonce
:=
uint64
(
0
)
if
stage
==
"queued"
{
nonce
=
2
...
...
This diff is collapsed.
Click to expand it.
core/vm/contracts.go
View file @
5a02b2d6
...
...
@@ -935,7 +935,7 @@ func (c *bls12381Pairing) Run(input []byte) ([]byte, error) {
return
nil
,
errBLS12381G2PointSubgroup
}
// Update pairing engine with G1 and G2 po
ni
ts
// Update pairing engine with G1 and G2 po
in
ts
e
.
AddPair
(
p1
,
p2
)
}
// Prepare 32 byte output
...
...
This diff is collapsed.
Click to expand it.
crypto/signature_cgo.go
View file @
5a02b2d6
...
...
@@ -48,7 +48,7 @@ func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error) {
//
// This function is susceptible to chosen plaintext attacks that can leak
// information about the private key that is used for signing. Callers must
// be aware that the given digest cannot be chosen by an advers
e
ry. Common
// be aware that the given digest cannot be chosen by an advers
a
ry. Common
// solution is to hash any input before calculating the signature.
//
// The produced signature is in the [R || S || V] format where V is 0 or 1.
...
...
This diff is collapsed.
Click to expand it.
eth/catalyst/api.go
View file @
5a02b2d6
...
...
@@ -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
// E
m
hemeral cache to track invalid blocks and their hit count
invalidBlocksHits
map
[
common
.
Hash
]
int
// E
p
hemeral 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
...
...
This diff is collapsed.
Click to expand it.
eth/downloader/queue.go
View file @
5a02b2d6
...
...
@@ -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-exist
ne
t,
// Retrieve the request being expired and log an error if it's non-exist
en
t,
// as there's no order of events that should lead to such expirations.
req
:=
pendPool
[
peer
]
if
req
==
nil
{
...
...
This diff is collapsed.
Click to expand it.
eth/downloader/skeleton.go
View file @
5a02b2d6
...
...
@@ -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
// af
t
er 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.
...
...
This diff is collapsed.
Click to expand it.
eth/fetcher/tx_fetcher.go
View file @
5a02b2d6
...
...
@@ -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
sgroup
ped by peer (DoS protection)
waitslots
map
[
string
]
map
[
common
.
Hash
]
struct
{}
// Waiting announcement
s grou
ped 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 rac
e
y,
// 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.
...
...
This diff is collapsed.
Click to expand it.
eth/protocols/eth/dispatcher.go
View file @
5a02b2d6
...
...
@@ -203,7 +203,7 @@ func (p *Peer) dispatcher() {
}
case
cancelOp
:=
<-
p
.
reqCancel
:
// Retrieve the pendi
gn
request to cancel and short circuit if it
// Retrieve the pendi
ng
request to cancel and short circuit if it
// has already been serviced and is not available anymore
req
:=
pending
[
cancelOp
.
id
]
if
req
==
nil
{
...
...
This diff is collapsed.
Click to expand it.
eth/protocols/eth/handler_test.go
View file @
5a02b2d6
...
...
@@ -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 expect
va
// Collect the hashes to request, and the response to expect
var
(
hashes
[]
common
.
Hash
bodies
[]
*
BlockBody
...
...
This diff is collapsed.
Click to expand it.
eth/protocols/eth/peer.go
View file @
5a02b2d6
...
...
@@ -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 asyn
c
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
{
...
...
This diff is collapsed.
Click to expand it.
eth/protocols/snap/handler.go
View file @
5a02b2d6
...
...
@@ -139,7 +139,7 @@ func HandleMessage(backend Backend, peer *Peer) error {
}
defer
msg
.
Discard
()
start
:=
time
.
Now
()
// Track the
e
mount of time it takes to serve the request and run the handler
// Track the
a
mount 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 faul
st
annoy the local user
// TODO(karalabe): - Logging locally is not ideal as remote faul
ts
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
...
...
This diff is collapsed.
Click to expand it.
eth/protocols/snap/range_test.go
View file @
5a02b2d6
...
...
@@ -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 sh
o
rter, capped at 0xff...f
// - The chunk ranges thus needs to be [..0, ..5], [..6, ..b], [..c, ..f]
{
head
:
common
.
HexToHash
(
"0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"
),
...
...
This diff is collapsed.
Click to expand it.
eth/protocols/snap/sync.go
View file @
5a02b2d6
...
...
@@ -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
// Dep
l
oyed 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 b
e
dth wise.
// heal requests to avoid overloading the local node and ex
c
essively expanding
// the state trie b
rea
dth wise.
minTrienodeHealThrottle
=
1
// maxTrienodeHealThrottle is the maximum divisor for throttling trie node
...
...
This diff is collapsed.
Click to expand it.
eth/tracers/internal/tracetest/calltrace_test.go
View file @
5a02b2d6
...
...
@@ -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 e
talon
// Retrieve the trace result and compare against the e
xpected.
res
,
err
:=
tracer
.
GetResult
()
if
err
!=
nil
{
t
.
Fatalf
(
"failed to retrieve trace result: %v"
,
err
)
...
...
This diff is collapsed.
Click to expand it.
eth/tracers/internal/tracetest/prestate_test.go
View file @
5a02b2d6
...
...
@@ -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 e
talon
// Retrieve the trace result and compare against the e
xpected
res
,
err
:=
tracer
.
GetResult
()
if
err
!=
nil
{
t
.
Fatalf
(
"failed to retrieve trace result: %v"
,
err
)
...
...
This diff is collapsed.
Click to expand it.
eth/tracers/internal/tracetest/util.go
View file @
5a02b2d6
...
...
@@ -6,7 +6,7 @@ import (
"strings"
"unicode"
// Force-load native and js pac
ak
ges, to trigger registration
// Force-load native and js pac
ka
ges, to trigger registration
_
"github.com/ethereum/go-ethereum/eth/tracers/js"
_
"github.com/ethereum/go-ethereum/eth/tracers/native"
)
...
...
This diff is collapsed.
Click to expand it.
ethclient/ethclient_test.go
View file @
5a02b2d6
...
...
@@ -392,7 +392,7 @@ func testTransactionInBlockInterrupted(t *testing.T, client *rpc.Client) {
t
.
Fatalf
(
"unexpected error: %v"
,
err
)
}
// Test tx in block interupted.
// Test tx in block inter
r
upted.
ctx
,
cancel
:=
context
.
WithCancel
(
context
.
Background
())
cancel
()
tx
,
err
:=
ec
.
TransactionInBlock
(
ctx
,
block
.
Hash
(),
0
)
...
...
This diff is collapsed.
Click to expand it.
internal/ethapi/api.go
View file @
5a02b2d6
...
...
@@ -456,7 +456,7 @@ func (s *PersonalAccountAPI) signTransaction(ctx context.Context, args *Transact
// passwd isn't able to decrypt the key it fails.
func
(
s
*
PersonalAccountAPI
)
SendTransaction
(
ctx
context
.
Context
,
args
TransactionArgs
,
passwd
string
)
(
common
.
Hash
,
error
)
{
if
args
.
Nonce
==
nil
{
// Hold the
addresse's
mutex around signing to prevent concurrent assignment of
// Hold the mutex around signing to prevent concurrent assignment of
// the same nonce to multiple accounts.
s
.
nonceLock
.
LockAddr
(
args
.
from
())
defer
s
.
nonceLock
.
UnlockAddr
(
args
.
from
())
...
...
@@ -1719,7 +1719,7 @@ func (s *TransactionAPI) SendTransaction(ctx context.Context, args TransactionAr
}
if
args
.
Nonce
==
nil
{
// Hold the
addresse's
mutex around signing to prevent concurrent assignment of
// Hold the mutex around signing to prevent concurrent assignment of
// the same nonce to multiple accounts.
s
.
nonceLock
.
LockAddr
(
args
.
from
())
defer
s
.
nonceLock
.
UnlockAddr
(
args
.
from
())
...
...
This diff is collapsed.
Click to expand it.
internal/version/version.go
View file @
5a02b2d6
...
...
@@ -95,7 +95,7 @@ func Info() (version, vcs string) {
// versionInfo returns version information for the currently executing
// implementation.
//
// Depending on how the code is instan
s
iated, it returns different amounts of
// Depending on how the code is instan
t
iated, it returns different amounts of
// information. If it is unable to determine which module is related to our
// package it falls back to the hardcoded values in the params package.
func
versionInfo
(
info
*
debug
.
BuildInfo
)
string
{
...
...
This diff is collapsed.
Click to expand it.
les/downloader/resultstore.go
View file @
5a02b2d6
...
...
@@ -142,7 +142,7 @@ func (r *resultStore) HasCompletedItems() bool {
// countCompleted returns the number of items ready for delivery, stopping at
// the first non-complete item.
//
// The mthod assumes (at least) rlock is held.
// The m
e
thod assumes (at least) rlock is held.
func
(
r
*
resultStore
)
countCompleted
()
int
{
// We iterate from the already known complete point, and see
// if any more has completed since last count
...
...
This diff is collapsed.
Click to expand it.
les/fetcher_test.go
View file @
5a02b2d6
...
...
@@ -282,7 +282,7 @@ func testInvalidAnnounces(t *testing.T, protocol int) {
peer
.
cpeer
.
sendAnnounce
(
announce
)
<-
done
// Wait syncing
// Ensure the bad peer is evic
i
ted
// Ensure the bad peer is evicted
if
c
.
handler
.
backend
.
peers
.
len
()
!=
0
{
t
.
Fatalf
(
"Failed to evict invalid peer"
)
}
...
...
This diff is collapsed.
Click to expand it.
les/flowcontrol/manager.go
View file @
5a02b2d6
...
...
@@ -223,7 +223,7 @@ func (cm *ClientManager) processed(node *ClientNode, maxCost, realCost uint64, n
cm
.
updateBuffer
(
node
,
int64
(
maxCost
-
realCost
),
now
)
}
// updateBuffer recalulates the corrected buffer value, adds the given value to it
// updateBuffer recal
c
ulates the corrected buffer value, adds the given value to it
// and updates the node's actual buffer value if possible
func
(
cm
*
ClientManager
)
updateBuffer
(
node
*
ClientNode
,
add
int64
,
now
mclock
.
AbsTime
)
{
cm
.
lock
.
Lock
()
...
...
This diff is collapsed.
Click to expand it.
les/odr.go
View file @
5a02b2d6
...
...
@@ -119,7 +119,7 @@ func (h peerByTxHistory) Less(i, j int) bool {
func
(
h
peerByTxHistory
)
Swap
(
i
,
j
int
)
{
h
[
i
],
h
[
j
]
=
h
[
j
],
h
[
i
]
}
const
(
maxTxStatusRetry
=
3
// The maximum retr
y
s will be made for tx status request.
maxTxStatusRetry
=
3
// The maximum retr
ie
s will be made for tx status request.
maxTxStatusCandidates
=
5
// The maximum les servers the tx status requests will be sent to.
)
...
...
This diff is collapsed.
Click to expand it.
les/server_requests.go
View file @
5a02b2d6
...
...
@@ -434,7 +434,7 @@ func handleGetProofs(msg Decoder) (serveRequestFn, uint64, uint64, error) {
continue
}
}
// Prove the user's request from the account or st
ro
age trie
// Prove the user's request from the account or st
or
age trie
if
err
:=
trie
.
Prove
(
request
.
Key
,
request
.
FromLevel
,
nodes
);
err
!=
nil
{
p
.
Log
()
.
Warn
(
"Failed to prove state request"
,
"block"
,
header
.
Number
,
"hash"
,
header
.
Hash
(),
"err"
,
err
)
continue
...
...
This diff is collapsed.
Click to expand it.
les/vflux/server/clientpool.go
View file @
5a02b2d6
...
...
@@ -53,7 +53,7 @@ var (
// each client can have several minutes of connection time.
//
// Balances of disconnected clients are stored in nodeDB including positive balance
// and negative ba
nalce. Boe
th positive balance and negative balance will decrease
// and negative ba
lance. Bo
th positive balance and negative balance will decrease
// exponentially. If the balance is low enough, then the record will be dropped.
type
ClientPool
struct
{
*
priorityPool
...
...
This diff is collapsed.
Click to expand it.
light/txpool.go
View file @
5a02b2d6
...
...
@@ -182,7 +182,7 @@ func (pool *TxPool) checkMinedTxs(ctx context.Context, hash common.Hash, number
}
// If some transactions have been mined, write the needed data to disk and update
if
list
!=
nil
{
// Retrieve all the receipts belonging to this block and write the loo
p
up table
// Retrieve all the receipts belonging to this block and write the loo
k
up table
if
_
,
err
:=
GetBlockReceipts
(
ctx
,
pool
.
odr
,
hash
,
number
);
err
!=
nil
{
// ODR caches, ignore results
return
err
}
...
...
This diff is collapsed.
Click to expand it.
miner/stress/1559/main.go
View file @
5a02b2d6
...
...
@@ -169,7 +169,7 @@ func makeTransaction(nonce uint64, privKey *ecdsa.PrivateKey, signer types.Signe
if
baseFee
==
nil
{
baseFee
=
new
(
big
.
Int
)
.
SetInt64
(
int64
(
rand
.
Int31
()))
}
// Generate the feecap, 75% valid feecap and 25% unguaranted.
// Generate the feecap, 75% valid feecap and 25% unguarante
e
d.
var
gasFeeCap
*
big
.
Int
if
rand
.
Intn
(
4
)
==
0
{
rand
.
Read
(
buf
)
...
...
This diff is collapsed.
Click to expand it.
mobile/interface.go
View file @
5a02b2d6
...
...
@@ -31,7 +31,7 @@ import (
// Since it's impossible to get the arbitrary-ness converted between Go and mobile
// platforms, we're using explicit getters and setters for the conversions. There
// is of course no point in enumerating everything, just enough to support the
// contract bindins requiring client side generated code.
// contract bindin
g
s requiring client side generated code.
type
Interface
struct
{
object
interface
{}
}
...
...
This diff is collapsed.
Click to expand it.
p2p/msgrate/msgrate.go
View file @
5a02b2d6
...
...
@@ -73,7 +73,7 @@ const rttMinConfidence = 0.1
const
ttlScaling
=
3
// ttlLimit is the maximum timeout allowance to prevent reaching crazy numbers
// if some unforeseen network events
s
happen. As much as we try to hone in on
// if some unforeseen network events happen. As much as we try to hone in on
// the most optimal values, it doesn't make any sense to go above a threshold,
// even if everything is slow and screwy.
const
ttlLimit
=
time
.
Minute
...
...
@@ -92,9 +92,9 @@ const tuningImpact = 0.25
// Tracker estimates the throughput capacity of a peer with regard to each data
// type it can deliver. The goal is to dynamically adjust request sizes to max
// out network throughput without overloading either the peer or th
e
local node.
// out network throughput without overloading either the peer or th
e
local node.
//
// By tracking in real time the latencies and band
iw
dths peers exhibit for each
// By tracking in real time the latencies and band
wi
dths peers exhibit for each
// packet type, it's possible to prevent overloading by detecting a slowdown on
// one type when another type is pushed too hard.
//
...
...
@@ -214,7 +214,7 @@ type Trackers struct {
// confidence represents the probability that the estimated roundtrip value
// is the real one across all our peers. The confidence value is used as an
// impact factor of new measurements on old estimates. As our connectivity
// stabilizes, this value gravitates towards 1, new measurements havin
n
g
// stabilizes, this value gravitates towards 1, new measurements having
// almost no impact. If there's a large peer churn and few peers, then new
// measurements will impact it more. The confidence is increased with every
// packet and dropped with every new connection.
...
...
@@ -316,7 +316,7 @@ func (t *Trackers) medianRoundTrip() time.Duration {
}
// MeanCapacities returns the capacities averaged across all the added trackers.
// The purpos of the mean capacities are to initialize a new peer with some sane
// The purpos
e
of the mean capacities are to initialize a new peer with some sane
// starting values that it will hopefully outperform. If the mean overshoots, the
// peer will be cut back to minimal capacity and given another chance.
func
(
t
*
Trackers
)
MeanCapacities
()
map
[
uint64
]
float64
{
...
...
This diff is collapsed.
Click to expand it.
signer/core/api.go
View file @
5a02b2d6
...
...
@@ -409,7 +409,7 @@ func (api *SignerAPI) List(ctx context.Context) ([]common.Address, error) {
// New creates a new password protected Account. The private key is protected with
// the given password. Users are responsible to backup the private key that is stored
// in the keystore location tha
s
was specified when this API was created.
// in the keystore location tha
t
was specified when this API was created.
func
(
api
*
SignerAPI
)
New
(
ctx
context
.
Context
)
(
common
.
Address
,
error
)
{
if
be
:=
api
.
am
.
Backends
(
keystore
.
KeyStoreType
);
len
(
be
)
==
0
{
return
common
.
Address
{},
errors
.
New
(
"password based accounts not supported"
)
...
...
@@ -635,7 +635,7 @@ func (api *SignerAPI) SignGnosisSafeTx(ctx context.Context, signerAddress common
gnosisTx
.
Signature
=
signature
gnosisTx
.
SafeTxHash
=
common
.
BytesToHash
(
preimage
)
gnosisTx
.
Sender
=
*
checkSummedSender
// Must be checksumed to be accepted by relay
gnosisTx
.
Sender
=
*
checkSummedSender
// Must be checksum
m
ed to be accepted by relay
return
&
gnosisTx
,
nil
}
...
...
This diff is collapsed.
Click to expand it.
tests/fuzzers/rangeproof/rangeproof-fuzzer.go
View file @
5a02b2d6
...
...
@@ -179,7 +179,7 @@ func (f *fuzzer) fuzz() int {
return
ok
}
// Fuzz is the fuzzing entry
y
-point.
// Fuzz is the fuzzing entry-point.
// The function must return
//
// - 1 if the fuzzer should increase priority of the
...
...
This diff is collapsed.
Click to expand it.
tests/fuzzers/runtime/runtime_fuzz.go
View file @
5a02b2d6
...
...
@@ -22,7 +22,7 @@ import (
// Fuzz is the basic entry point for the go-fuzz tool
//
// This returns 1 for valid pars
able/ru
nable code, 0
// This returns 1 for valid pars
e:able/run
nable code, 0
// for invalid opcode.
func
Fuzz
(
input
[]
byte
)
int
{
_
,
_
,
err
:=
runtime
.
Execute
(
input
,
input
,
&
runtime
.
Config
{
...
...
This diff is collapsed.
Click to expand it.
trie/proof.go
View file @
5a02b2d6
...
...
@@ -373,7 +373,7 @@ func unset(parent node, child node, key []byte, pos int, removeLeft bool) error
if
removeLeft
{
if
bytes
.
Compare
(
cld
.
Key
,
key
[
pos
:
])
<
0
{
// The key of fork shortnode is less than the path
// (it belongs to the range), unset the ent
ri
e
// (it belongs to the range), unset the ent
ir
e
// branch. The parent must be a fullnode.
fn
:=
parent
.
(
*
fullNode
)
fn
.
Children
[
key
[
pos
-
1
]]
=
nil
...
...
This diff is collapsed.
Click to expand it.
trie/stacktrie.go
View file @
5a02b2d6
...
...
@@ -494,7 +494,7 @@ func (st *StackTrie) Hash() (h common.Hash) {
return
h
}
// Commit will firstly hash the ent
ri
e trie if it's still not hashed
// Commit will firstly hash the ent
ir
e trie if it's still not hashed
// and then commit all nodes to the associated database. Actually most
// of the trie nodes MAY have been committed already. The main purpose
// here is to commit the root node.
...
...
This diff is collapsed.
Click to expand it.
trie/trie_test.go
View file @
5a02b2d6
...
...
@@ -609,7 +609,7 @@ func benchUpdate(b *testing.B, e binary.ByteOrder) *Trie {
}
// Benchmarks the trie hashing. Since the trie caches the result of any operation,
// we cannot use b.N as the number of hashing rouns, since all rounds apart from
// we cannot use b.N as the number of hashing roun
d
s, since all rounds apart from
// the first one will be NOOP. As such, we'll use b.N as the number of account to
// insert into the trie before measuring the hashing.
// BenchmarkHash-6 288680 4561 ns/op 682 B/op 9 allocs/op
...
...
@@ -644,7 +644,7 @@ func BenchmarkHash(b *testing.B) {
}
// Benchmarks the trie Commit following a Hash. Since the trie caches the result of any operation,
// we cannot use b.N as the number of hashing rouns, since all rounds apart from
// we cannot use b.N as the number of hashing roun
d
s, since all rounds apart from
// the first one will be NOOP. As such, we'll use b.N as the number of account to
// insert into the trie before measuring the hashing.
func
BenchmarkCommitAfterHash
(
b
*
testing
.
B
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment