Commit Graph

13734 Commits

Author SHA1 Message Date
s7v7nislands
461835ae71 core/vm: clean up some dead functions (#24851) 2022-09-21 17:02:02 +08:00
aaronbuchwald
4feeaf3545 core/vm: update benchmark to use Errorf instead of Sprintf (#24845) 2022-09-21 17:02:02 +08:00
Sina Mahmoodi
5d980a0e43 internal: drop TestSignCliqueBlock (#24837) 2022-09-21 17:02:02 +08:00
Marius van der Wijden
e8b93382da core/state/snapshot: fix race condition (#24685)
Fixes three race conditions found through fuzzing by David Theodore
2022-09-21 17:02:02 +08:00
Rachel Franks
5a06ca3698 abi: fix checks when all fields are indexed (#24792)
This PR fixes abi checks in the edge case where all arguments are indexed
2022-09-21 17:02:02 +08:00
Martin Holst Swende
8d19185040 eth/fetcher: avoid hang in tests (partial fix for #23331) (#23351)
* eth/fetcher: fix test to avoid hanging. Partial fix for #23331

* eth/filters: avoid dangling goroutines

* eth/fetcher: revert closing of proceed
2022-09-21 17:02:02 +08:00
ImanSharaf
f781ea8a2f p2p/simulations: escape mockerType value from request (#24822)
Co-authored-by: Felix Lange <fjl@twurst.com>
2022-09-21 17:02:02 +08:00
EXEC
098181224e eth/filters: remove explicit continue label in filterLogs (#24795)
The loop label can be removed because this 'continue' statement
is not in a nested loop.
2022-09-21 17:02:02 +08:00
Evgeny Kolyakov
bd22292a32 build: fix formatted logs (#24807)
Changed `log.Fatal` to `log.Fatalf()` as it has a parameter...
2022-09-21 17:02:02 +08:00
Martin Holst Swende
cea831914b cmd/utils: double limit on free-disk monitor (#24781)
This PR doubles the limit on which to trigger automatic shutdown, and also changes the timer to run once every 30s instead of 60s.
2022-09-21 17:02:02 +08:00
EXEC
58f1e8b94c docker: speed up docker image build (#24796)
This PR improves the docker build speed for repeated builds where go.mod and go.sum do no change, by placing the downloaded dependencies in a lower layer
2022-09-21 17:02:02 +08:00
hero5512
f67e303a1c eth/filters: remove unused struct fields (#24782) 2022-09-21 17:02:02 +08:00
Joshua Gutow
a181eeee16 ethclient/gethclient: return storage proofs in GetProof (#24697)
Storage proofs were being unmarshalled from the RPC form to the go struct, but were not being included in the final returned struct.
2022-09-21 17:02:02 +08:00
tia-99
34420d03c5 core/types: fix unhandled errors in TestTransactionCoding (#24692) 2022-09-21 17:02:02 +08:00
henopied
ae31b5ff72 p2p: fix type of DiscSubprotocolError (#24747)
It was 'int' accidentally, should be DiscReason instead.
2022-09-21 17:02:02 +08:00
Nikita Kozhemyakin
6aae1bcc81 mobile: fix receipt encoding to json (#24701) 2022-09-21 17:02:02 +08:00
jwasinger
30c695c5e2 cmd/evm: ensure input length is even (#24721)
* cmd/evm: ensure input length is even

* cmd/evm: minor nit + lintfix

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-09-21 17:02:02 +08:00
Emmanuel T Odeke
3766168264 eth/tracers/logger: remove unnecessary comparisons in accessList.equal (#24663)
This change removes extraneous/unnecessary checks for equality
when comparing 2 accessList values A and B. Given that we validate that
their lengths of A and B are equal, if so and if every element in A is
in B, reflexively every element in B is already in A. If that weren't
the case and an element g existed in A but not in B, that would mean
that there is an extra element and hence a mathematical contradiction.

Fixes #24658
2022-09-21 17:02:02 +08:00
Darioush Jalali
3081421141 trie: remove unused makeHashNode (#24702) 2022-09-21 17:02:02 +08:00
rjl493456442
a72324355a core: fix benchmark panic (#24657)
This PR fixes a few panics in the chain marker benchmarks. The root
cause for panic is in chain marker the genesis header/block is not
accessible, while it's expected to be obtained in tests. So this PR
avoids touching genesis header at all to avoid panic.
2022-09-21 17:02:02 +08:00
Felix Lange
f37f2a9fbe core/types: make "miner" optional in Header JSON (#24666)
"miner" is not set for pending block responses in some cases.

Fixes #24632
2022-09-21 17:02:02 +08:00
rjl493456442
a41619f04e les: fix panic in ultralight client sync (#24641) 2022-09-21 17:02:02 +08:00
Péter Szilágyi
f310921b41 core/state/snapshot: remove noop map item assignment 2022-09-21 17:02:02 +08:00
Péter Szilágyi
211ab45c1d eth/fetcher: if peers never respond, drop them 2022-09-21 17:02:02 +08:00
Nic Jansma
c54fd7f312 eth: change snapshot extension registration failure to warning instead of error (#24475)
* core: Change Snapshot extension registration failed to Debug

* Update eth/handler.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-09-21 17:02:02 +08:00
Martin Holst Swende
3b4c68381b eth/tracers/logger: use omitempty to reduce log bloat (#24547)
Makes the evm json output less verbose: omitting output of `memory` and `returndata` in case they are empty.
2022-09-21 17:02:02 +08:00
ucwong
3d5896a157 go.mod : upnp 1.0.3 stable version (#24573) 2022-09-21 17:02:02 +08:00
zjubfd
3d3f0a85db
ci: add curl in docker file 2022-09-14 14:49:07 +08:00
zjubfd
b8020b9746
fix: remove fixed curl version in docker file 2022-09-06 16:42:21 +08:00
zjubfd
6f6bbcfe46
Merge pull request #1056 from bnb-chain/develop
prepare for release v1.1.13
v1.1.13
2022-09-02 11:31:36 +08:00
Roshan
aa835e020b
upgrade: update version and CHANGELOG.md (#1073) 2022-08-31 17:04:48 +08:00
Roshan
fd6fa7c9ce
fix: update cross chain logic of native stake (#1066) 2022-08-31 14:42:23 +08:00
zjubfd
755df16c9a
Merge pull request #1068 from qinglin89/dev-rlp 2022-08-31 13:30:59 +08:00
Leon
64549a75eb
statedb: get rid of activestate, stopPrefetcher manually (#1006) 2022-08-31 13:30:25 +08:00
bittrainee
b485651b86
fix: fix potential goroutine leak (#1067) 2022-08-31 12:38:09 +08:00
dylanhuang
f45759858d
txpool: reheap the priced list if london fork not enabled (#1070) 2022-08-31 12:37:20 +08:00
qinglin89
24da9ec194 fix: gomod add packages 2022-08-26 14:46:17 +08:00
Qian Bin
da57d11ecc rlp trie: faster trie node encoding (#24126)
This change speeds up trie hashing and all other activities that require
RLP encoding of trie nodes by approximately 20%. The speedup is achieved by
avoiding reflection overhead during node encoding.

The interface type trie.node now contains a method 'encode' that works with
rlp.EncoderBuffer. Management of EncoderBuffers is left to calling code.
trie.hasher, which is pooled to avoid allocations, now maintains an
EncoderBuffer. This means memory resources related to trie node encoding
are tied to the hasher pool.

Co-authored-by: Felix Lange <fjl@twurst.com>
2022-08-26 14:46:13 +08:00
Felix Lange
25337f5aba core/types: faster RLP encoding of Header, StateAcccount, Re... (#24420)
This change makes use of the new code generator rlp/rlpgen to improve the
performance of RLP encoding for Header and StateAccount. It also speeds up
encoding of ReceiptForStorage using the new rlp.EncoderBuffer API.

The change is much less transparent than I wanted it to be, because Header and
StateAccount now have an EncodeRLP method defined with pointer receiver. It
used to be possible to encode non-pointer values of these types, but the new
method prevents that and attempting to encode unadressable values (even if
part of another value) will return an error. The error can be surprising and may
pop up in places that previously didn't expect any errors.

To make things work, I also needed to update all code paths (mostly in unit tests)
that lead to encoding of non-pointer values, and pass a pointer instead.

Benchmark results:

    name                             old time/op    new time/op    delta
    EncodeRLP/legacy-header-8           328ns ± 0%     237ns ± 1%   -27.63%  (p=0.000 n=8+8)
    EncodeRLP/london-header-8           353ns ± 0%     247ns ± 1%   -30.06%  (p=0.000 n=8+8)
    EncodeRLP/receipt-for-storage-8     237ns ± 0%     123ns ± 0%   -47.86%  (p=0.000 n=8+7)
    EncodeRLP/receipt-full-8            297ns ± 0%     301ns ± 1%    +1.39%  (p=0.000 n=8+8)

    name                             old speed      new speed      delta
    EncodeRLP/legacy-header-8        1.66GB/s ± 0%  2.29GB/s ± 1%   +38.19%  (p=0.000 n=8+8)
    EncodeRLP/london-header-8        1.55GB/s ± 0%  2.22GB/s ± 1%   +42.99%  (p=0.000 n=8+8)
    EncodeRLP/receipt-for-storage-8  38.0MB/s ± 0%  64.8MB/s ± 0%   +70.48%  (p=0.000 n=8+7)
    EncodeRLP/receipt-full-8          910MB/s ± 0%   897MB/s ± 1%    -1.37%  (p=0.000 n=8+8)

    name                             old alloc/op   new alloc/op   delta
    EncodeRLP/legacy-header-8           0.00B          0.00B           ~     (all equal)
    EncodeRLP/london-header-8           0.00B          0.00B           ~     (all equal)
    EncodeRLP/receipt-for-storage-8     64.0B ± 0%      0.0B       -100.00%  (p=0.000 n=8+8)
    EncodeRLP/receipt-full-8             320B ± 0%      320B ± 0%      ~     (all equal)
2022-08-26 14:44:54 +08:00
Felix Lange
1d6c01ab0b rlp/rlpgen: RLP encoder code generator (#24251)
This change adds a code generator tool for creating EncodeRLP method
implementations. The generated methods will behave identically to the
reflect-based encoder, but run faster because there is no reflection overhead.

Package rlp now provides the EncoderBuffer type for incremental encoding. This
is used by generated code, but the new methods can also be useful for
hand-written encoders.

There is also experimental support for generating DecodeRLP, and some new
methods have been added to the existing Stream type to support this. Creating
decoders with rlpgen is not recommended at this time because the generated
methods create very poor error reporting.

More detail about package rlp changes:

* rlp: externalize struct field processing / validation

This adds a new package, rlp/internal/rlpstruct, in preparation for the
RLP encoder generator.

I think the struct field rules are subtle enough to warrant extracting
this into their own package, even though it means that a bunch of
adapter code is needed for converting to/from rlpstruct.Type.

* rlp: add more decoder methods (for rlpgen)

This adds new methods on rlp.Stream:

- Uint64, Uint32, Uint16, Uint8, BigInt
- ReadBytes for decoding into []byte
- MoreDataInList - useful for optional list elements

* rlp: expose encoder buffer (for rlpgen)

This exposes the internal encoder buffer type for use in EncodeRLP
implementations.

The new EncoderBuffer type is a sort-of 'opaque handle' for a pointer to
encBuffer. It is implemented this way to ensure the global encBuffer pool
is handled correctly.
2022-08-26 14:44:18 +08:00
zjubfd
f2b1f3f128
Merge pull request #1061 from qinglin89/dev-merge
fix: upstream patches
2022-08-23 10:43:14 +08:00
Zhang Zhuo
94885ae9ca core/vm: fix sstore gas comment type (#24583) 2022-08-22 14:43:14 +08:00
rjl493456442
9c72720d9f eth/downloader: ignore zero size header batch for importing (#24569)
* eth/downloader: ignore zero size header batch for importing

* core, light: reject empty header batch for importing
2022-08-22 14:43:14 +08:00
rjl493456442
c1d9690013 les, tests: fix vflux fuzzer by removing unnecessary panic (#24537) 2022-08-22 14:43:14 +08:00
Guifel
3572eb7b20 eth/tracers: use hex encoding for debug_traceBlock argument (#24517) 2022-08-22 14:43:14 +08:00
ligi
f8e2104b52 build: fix linter install on windows (#24523) 2022-08-22 14:43:14 +08:00
rjl493456442
d130c0e423 trie: fix two issues in trie iterator (#24539)
* trie: fix memory leak in trie iterator

In the trie iterator, live nodes are tracked in a stack while iterating.
Popped node states should be explictly set to nil in order to get
garbage-collected.

* trie: fix empty trie iterator
2022-08-22 14:43:14 +08:00
s7v7nislands
799f041ae1 rpc: fix defer in test (#24490)
Co-authored-by: Felix Lange <fjl@twurst.com>
2022-08-22 14:43:14 +08:00
Martin Holst Swende
0e65495310 eth/protocols/snap: avoid estimating infinite percentage 2022-08-22 14:43:14 +08:00
Zachinquarantine
9843a36bec mobile: remove deprecated Stop function (#24369) 2022-08-22 14:43:14 +08:00