Commit Graph

13855 Commits

Author SHA1 Message Date
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
zjubfd
a02c4fabc8
Merge pull request #816 from bnb-chain/merge_eth
[R4R] merge go-ethereum
2022-07-06 11:06:11 +08:00
j75689
b01b45a33e Merge branch 'develop' into merge_eth 2022-07-05 11:18:13 +08:00
j75689
79bd42836c fix: code compatibility fixes 2022-07-05 11:14:21 +08:00
dean
0483394ef6
[R4R] Separate Processing and State Verification on BSC (#926)
Implement Separate Processing and State Verification on BSC
2022-07-04 09:49:07 +08:00
zjubfd
0f3bfa888e
Merge pull request #959 from KeefeL/keefe/dev
[R4R]update some packages' version
2022-06-30 11:44:09 +08:00
joeycli
d6b9bdbc84
add prune ancient feature (#862)
* add prune ancient feature

* change notes and log for pr suggest

* change StableStateBloc to SafePointBlock and enhanced 'pruneancient' flag hints

* change pruneancient usage

* fix note misspelling

* fix set SafePointBlockNumber by mpt height replace current block number

Co-authored-by: user <joeycli0919@qq.com>
2022-06-29 18:47:25 +08:00
zjubfd
ba120d04ef
Merge pull request #961 from KeefeL/develop
[R4R] sync with master branch
2022-06-29 12:23:47 +08:00
Larry
5b5cc005d9
Merge pull request #950 from setunapo/improve_state_prefetch
Improve state prefetch
2022-06-24 10:53:25 +08:00
Larry
128977c105
Merge pull request #953 from qinglin89/fix-evm
correct logic for eip check of NewEVMInterpreter
2022-06-24 10:48:16 +08:00
Keefe-Liu
c45130e3eb Merge branch 'master' into develop 2022-06-24 01:03:18 +08:00
zjubfd
6ec6edaad8
Merge pull request #958 from KeefeL/keefe/bugfix
[R4R] p2p: define DiscReason as uint8
2022-06-23 10:36:36 +08:00
Keefe-Liu
5ef4a2b329 upgrade gogo/protobuf to version v1.3.2 2022-06-23 03:05:11 +08:00
Keefe-Liu
fcfc57feb3 upgrade docker version to 1.6.1 2022-06-23 03:03:36 +08:00
Felix Lange
4b8c03b129 p2p: define DiscReason as uint8 (#24507)
All other implementations store disconnect reasons as a single byte,
so go-ethereum should do it too.
2022-06-23 02:42:38 +08:00
qinglin89
0137f20a31 refactor: cuncurrency safe for state_prefetcher 2022-06-21 12:36:59 +08:00
qinglin89
ebceb25176 fix:correct logic for eip check of NewEVMInterpreter 2022-06-20 18:47:25 +08:00
setunapo
8c36d29f99 Improve the state prefetch dispatch policy
** replace atomic read by channel close to interrupt state prefetch
** try to do state prefetch when the prefetch thread is idle, no need to divide into 3 sub-arrays
   it will make the prefetchers workload balance
2022-06-20 14:59:51 +08:00
setunapo
28f80903dd Improve StatePrefetch, use AsMessageNoNonceCheck to skip nonce check
For state prefetch, no need to check transaction's nonce,
since the transaction's result will be discarded anyway.
2022-06-17 16:05:28 +08:00
WayToFuture
85371535d7
fix pipecommit issue (#932) 2022-06-13 16:40:14 +08:00
zjubfd
de4abf9d09
Merge pull request #943 from RumeelHussainbnb/patch-1
[R4R]Updated Links to docs.bnbchain.org
2022-06-13 11:24:16 +08:00
RumeelHussainbnb
02e91287d6
Updated Links to docs.bnbchain.org 2022-06-10 13:22:59 +05:00
zjubfd
70d08a5791
Merge pull request #942 from bnb-chain/hardfork_euler_mainnet
[R4R] Release For BSC v1.1.11
v1.1.11
2022-06-08 21:56:50 +08:00
cosinlink
979bb8fca9 feat: add release info of BSC v1.1.11 2022-06-07 17:19:26 +08:00
cosinlink
0080707fc7 feat: update Euler Fork blockNumber 2022-06-07 16:52:10 +08:00
flywukong
aa3cc8253f
Merge pull request #924 from flywukong/improve-updateSnap
asynchronous  update snap in  updatetrie
2022-06-07 14:06:12 +08:00
flywukong
fea1c96d28 asynchronous update snap in updatetrie 2022-06-07 12:00:35 +08:00
WayToFuture
2288373b7e
Merge pull request #905 from forcodedancing/improve_snap_lock
[R4R] improve snap mutex
2022-06-07 09:57:35 +08:00
goth
b8413b129e chores: add BEP-127 operation readme 2022-05-26 11:50:59 +08:00
forcodedancing
fe2d84bd4a improve snap mutex 2022-05-12 10:07:01 +08:00
zjubfd
2f2b98abb2
Merge pull request #888 from bnb-chain/develop
[R4R] Release For BSC v1.1.10
v1.1.10
2022-05-05 17:26:16 +08:00
zjubfd
55ef216c66 relace binance to bnb in changelog 2022-05-05 13:32:24 +08:00
zjubfd
b679ba81f2
prepare for release v1.1.10 (#889) 2022-05-05 11:29:33 +08:00
Gothery
4feb52e5b0
[R4R]: add Euler Hardfork, including BEP-127 and BEP-131 (#885)
* feat: add BEP-127 and BEP-131 hardfork bytecode to upgrade

* feat: force check that Euler height cannot be a multiple of 200, fix getCurrentValidators, raise SystemTxsGas after Euler fork

Co-authored-by: goth <goth>
2022-04-29 18:03:22 +08:00
WayToFuture
5b5abc4e22
[R4R] fix validator pipecommit issue (#877)
* fix validator account root issue in piepecommit

* fix test and imports

* add check for snap

* refacto a bit
2022-04-29 15:45:55 +08:00
Leon
717b38c5f5
[R4R] fix:defer bloomprocessor close (#860)
* fix:defer bloomprocessor close

* fix: fix deadlock in Close

* perf:rm defer bloomprocessors Close and manual close before return
2022-04-28 18:22:02 +08:00
Leon
0f5a4c87db
[R4R]fix:Shift panic for zero length of heads (#870)
* fix:Shift panic for zero length of heads

* fix: make sure peek before shift

* refactor and update ut

* refactor
2022-04-25 10:47:02 +08:00
Jolly Zhao
15bc2548c1
fix logic issue: handlers.removePeer() is called twice. (#856)
* fix logic issue: handlers.removePeer() is called twice.

There is a logic issue which cause "Ethereum peer removal failed, err=peer not registered" occur quite often.

handler.runEthPeer set up a defer removePeer(). This is always called after a peer is disconnected.
However removePeer is also called by mulitple functions like downloader/fetcher.  After those kind of functions removePeer(), peer handler executes defer removePeer(). This makes removePeer() happened twice, and this is the reason we often see "Ethereum peer removal failed, err=peer not registered".

To solve this, removePeer only needs to hard Disconnect peer from networking layer. Then defer unregisterPeer() will do the cleanup task after then.

* fix: modify test function for close testing.

reference from go-thereum.

Co-authored-by: zjubfd <296179868@qq.com>
2022-04-24 14:24:07 +08:00
zjubfd
74ecbf271d
Merge pull request #850 from bnb-chain/develop
[R4R] Release v1.1.9
v1.1.9
2022-04-08 19:06:42 +08:00