Commit Graph

13693 Commits

Author SHA1 Message Date
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
Ceyhun Onur
413a42d9ce core/rawdb: add HasCode, HashTrieNode and use them where possible (#24454) 2022-08-22 14:43:14 +08:00
dylanhuang
2e22fe399c
ci: fix the pattern of commit lint (#1063) 2022-08-22 11:25:31 +08:00
dylanhuang
c3e3b1128d
consensus: fix the GasLimitBoundDivisor (#1060) 2022-08-22 11:24:50 +08:00
dylanhuang
02b31abc5a
test: fix TestOfflineBlockPrune (#1062) 2022-08-22 11:24:18 +08:00
Felföldi Zsolt
e5f4fde8ef les/vflux/client: fix goroutine leak in testIter (#24449) 2022-08-19 07:43:25 +08:00
Guruprasad Kamath
62d66e4656 appveyor.yml: fetch sub-modules recursively (#24451) 2022-08-19 07:41:15 +08:00
Sina Mahmoodi
7bb1463a63 graphql: fix nonce for pending accounts (#24443) 2022-08-19 07:40:41 +08:00
b1ackd0t
c1dd16f4ce internal/ethapi: fix incorrect type on empty slice (#24372)
* Fixes #24368

Signed-off-by: 0x6f736f646f <blackd0t@protonmail.com>

* Update internal/ethapi/api.go

Co-authored-by: Martin Holst Swende <martin@swende.se>
2022-08-19 07:35:43 +08:00
zhiqiangxu
a1db38af74 p2p: reduce the scope of variable dialPubkey (#24385)
dialPubkey isn't used anywhere else after dialDest.Load, so it should be safe to
restrict its scope to the if clause.
2022-08-19 07:33:07 +08:00
Martin Holst Swende
788b77115c core/state: fix read-meters + simplify code (#24304) 2022-08-19 07:31:35 +08:00
setunapo
e64fde1840 ci: allow merge pull request 2022-08-19 06:43:12 +08:00
Roshan
11d2bae157
bep153: Native Staking on BSC (#1051) 2022-08-18 14:36:45 +08:00
setunapo
ddbe6c4f77 ci: no type-case check for scope. 2022-08-17 19:24:48 +08:00
joeycli
dbb047bccc
Merge pull request #1053 from bnb-chain/fix_opendatabase_fail
state: fix offline tool start failed when start with pruneancient
2022-08-17 14:29:11 +08:00
dylanhuang
05d8399cdf
ci: add commit message lint (#1044) 2022-08-16 19:01:24 +08:00
joeycli
895c077f8a fix bug #1034, offline tool start failed when start with pruneancient 2022-08-16 14:02:45 +08:00
Alex Vorona
723863ee56
Dockerfile: update ca-certificates version (#1038) 2022-08-08 18:09:02 +08:00
Leon
76e3c9071a [R4R] Pipecommit enable trie prefetcher (#992) 2022-08-01 17:41:50 +08:00
setunapo
77c8372cc4 Trie prefetch on state pretch (#996)
* feature: do trie prefetch on state prefetch

Currently, state prefetch just pre execute the transactions and discard the results.
It is helpful to increase the snapshot cache hit rate.
It would be more helpful, if it can do trie prefetch at the same time, since the it will
preload the trie node and build the trie tree in advance.
This patch is to implement it, by reusing the main trie prefetch and doing finalize after
transaction is executed.

* some code improvements for trie prefetch

** increase pendingSize before dispatch tasks
** use throwaway StateDB for TriePrefetchInAdvance and remove the prefetcherLock
** remove the necessary drain operation in trie prefetch mainloop,
   trie prefetcher won't be used after close.
2022-08-01 17:41:50 +08:00
setunapo
df3e1be9d3 [Feature]: Improve trie prefetch (#952)
* trie prefetcher for From/To address in advance

We found that trie prefetch could be not fast enough, especially trie prefetch of
the outer big state trie tree.
Instead of do trie prefetch until a transaction is finalized, we could do trie prefetch
in advance. Try to prefetch the trie node of the From/To accounts, since their root hash
are most likely to be changed.

* Parallel TriePrefetch for large trie update.

Currently, we create a subfetch for each account address to do trie prefetch. If the address
has very large state change, trie prefetch could be not fast enough, e.g. a contract modified
lots of KV pair or a large number of account's root hash is changed in a block.

With this commit, there will be children subfetcher created to do trie prefetch in parallell if
the parent subfetch's workload exceed the threshold.

* some improvemnts of parallel trie prefetch implementation

1.childrenLock is removed, since it is not necessary
  APIs of triePrefetcher is not thread safe, they should be used sequentially.
  A prefetch will be interrupted by trie() or clos(), so we only need mark it as
  interrupted and check before call scheduleParallel to avoid the concurrent access to paraChildren
2.rename subfetcher.children to subfetcher.paraChildren
3.use subfetcher.pendingSize to replace totalSize & processedIndex
4.randomly select the start child to avoid always feed the first one
5.increase threshold and capacity to avoid create too many child routine

* fix review comments

** nil check refine
** create a separate routine for From/To prefetch, avoid blocking the cirtical path

* remove the interrupt member

* not create a signer for each transaction

* some changes to triePrefetcher

** remove the abortLoop, move the subfetcher abort operation into mainLoop
   since we want to make subfetcher's create & schedule & abort within a loop to
   avoid concurrent access locks.

** no wait subfetcher's term signal in abort()
   it could speed up the close by closing subfetcher concurrently.
   we send stop signnal to all subfetchers in burst and wait their term signal later.

* some coding improve for subfetcher.scheduleParallel

* fix a UT crash of s.prefetcher == nil

* update parallel trie prefetcher configuration

tested with different combination of parallelTriePrefetchThreshold & parallelTriePrefetchCapacity,
found the most efficient configure could be:
  parallelTriePrefetchThreshold = 10
  parallelTriePrefetchCapacity  = 20

* fix review comments: code refine
2022-08-01 17:41:50 +08:00
kyrie-yl
51bfecacb0 broadcast block before commit block and add metrics (#975)
Signed-off-by: cryyl <yl.on.the.way@gmail.com>
2022-08-01 17:41:50 +08:00
zjubfd
f68965a615
Merge pull request #1025 from bnb-chain/develop
[R4R] Release v1.1.12
v1.1.12
2022-07-28 19:05:28 +08:00
dylanhuang
09dfd2ff7e
prepare for release v1.1.12 (#1023) 2022-07-28 17:25:47 +08:00
zjubfd
6c46c59f27
fix: verify node is not treated as verify node (#1024) 2022-07-28 13:58:33 +08:00
dylanhuang
06bc2a0681
fix: remove diffhash patch introduced fro (#1020) 2022-07-27 13:58:49 +08:00
Leon
a2a90d3212
Fix pipecommit about activeState (#1002)
* get copy of prefetcher before use to avoid been modified between access and not-nil condition
2022-07-27 01:24:28 +08:00
Leon
71f0caa6cf
Remove duplicate update/delete on tire (#1001)
* rm duplicate update/delete on tire
* rm useless code
2022-07-27 01:23:19 +08:00
dylanhuang
dd3b3a69b5
fix: memory leak issue with diff protocol (#1019) 2022-07-26 16:33:59 +08:00
zjubfd
cd46de9e0b
log: disable noisy logs since system transaction will cause gas capping (#1015) 2022-07-25 21:13:49 +08:00
zjubfd
0ed265c5e0
fix: fast node can not recover from force kill or panic (#1014) 2022-07-25 21:12:45 +08:00
joeycli
9d59a140d6
[R4R]fix: tools broken because of writting metadata when open a readyonly db (#1013)
* freezer batch compatible offline prunblock command

adjust pruneblock local var

* not write metadata to db when open db with readyonly
2022-07-25 09:56:17 +08:00
joeycli
d93211b310
[R4R]db: freezer batch compatible offline prunblock command (#1005)
[R4R]db: freezer batch compatible offline prunblock command (#1005)
2022-07-22 16:11:34 +08:00
dylanhuang
403b19c629
[R4R] fix: Incorrect merkle root issue when enabling pipecommit with miner (#1011)
[R4R] fix: Incorrect merkle root issue when enabling pipecommit with miner (#1011)
2022-07-22 15:58:06 +08:00
kyrie-yl
015c527b60
[R4R]fix: resolve the concurrent cache read and write issue for fast node (#1009)
* fix cache read and write concurrency issue of empty block

Signed-off-by: cryyl <yl.on.the.way@gmail.com>

* fix: limit the size of chainHeadChanSize

Co-authored-by: zjubfd <296179868@qq.com>
2022-07-22 15:54:06 +08:00
dylanhuang
21c4ecee3e
fix: incorrect behavior of miner (#1007) 2022-07-20 17:33:51 +08:00
Jason Yi
37b7ac7b71
feat: update dockerfile with a few enhancement (#998)
* feat: refactor dockerfile to add entrypoint script
2022-07-20 12:07:00 +08:00
dylanhuang
659f670b9b
ci: add script to docker image (#990) 2022-07-19 15:55:32 +08:00
dylanhuang
fd1d1e356e
fix: nil pointer issue when stopping mining new block (#983) 2022-07-08 13:17:40 +08:00
setunapo
8e74562179
[R4R]: Redesign triePrefetcher to make it thread safe (#972)
* Redesign triePrefetcher to make it thread safe

There are 2 types of triePrefetcher instances:
1.New created triePrefetcher: it is key to do trie prefetch to speed up validation phase.
2.Copied triePrefetcher: it only copy the prefetched trie information, actually it won't do
  prefetch at all, the copied tries are all kept in p.fetches.

Here we try to improve the new created one, to make it concurrent safe, while the copied one's
behavior stay unchanged(its logic is very simple).
As commented in triePrefetcher struct, its APIs are not thread safe. So callers should make sure
the created triePrefetcher should be used within a single routine.
As we are trying to improve triePrefetcher, we would use it concurrently, so it is necessary to
redesign it for concurrent access.

The design is simple:
** start a mainLoop to do all the work, APIs just send channel message.

Others:
** remove the metrics copy, since it is useless for copied triePrefetcher
** for trie(), only get subfetcher through channel to reduce the workload of mainloop

* some code enhancement for triePrefetcher redesign

* some fixup: rename, temporary trie chan for concurrent safe.

* fix review comments

* add some protection in case the trie prefetcher is already stopped

* fix review comments

** make close concurrent safe
** fix potential deadlock

* replace channel by RWMutex for a few triePrefetcher APIs

For APIs like: trie(), copy(), used(), it is simpler and more efficient to
use a RWMutex instead of channel communicaton.
Since the mainLoop would be busy handling trie request, while these trie request
can be processed in parallism.

We would only keep prefetch and close within the mainLoop, since they could update
the fetchers

* add lock for subfecter.used access to make it concurrent safe

* no need to create channel for copied triePrefetcher

* fix trie_prefetcher_test.go

trie prefetcher’s behavior has changed, prefetch() won't create subfetcher immediately.
it is reasonable, but break the UT, to fix the failed UT
2022-07-07 10:00:09 +08:00
zjubfd
552e404e8c
Merge pull request #976 from j75689/fix/difflayer_ut
[R4R] fix asynchronous caching of difflayer causes random errors in tests
2022-07-06 19:16:52 +08:00
j75689
b6c02a492c fix: asynchronous caching of difflayer causes random errors in tests 2022-07-06 15:43:33 +08:00