* 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>
** 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
* 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>
* 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>
* pipeline state verification
* update codes and add logs for debug
* refactor
* update and add logs
* refactor
* refactor
* remove unneeded logs
* fix a blocking issue
* fix sync issue when force kill
* remove logs
* refactor based on comments
* refactor based on comments
* refactor based on comments
* refactor based on comments
* refactor based on comments
* fix a deadlock issue
* fix merkle root mismatch issue during sync
* refactor based on review comments
* remove unnecessary code
* remove unnecessary code
* refactor based on review comments
* change based on comments
* refactor
* uew dummyRoot to replace emptyRoot
* add nil check
* add comments
* remove unneeded codes
* format comments
Co-authored-by: forcodedancing <liguo.fudan@gmail.com>
* add sharedStorage for prefetching to L1
* remote originStorage in stateObjects
* fix core
* fix bug of sync map
* remove read lock when get & set keys
* statedb copy use CopyWithSharedStorage
* reduce lock access
* fix comment
* avoid sharedPool effects on other modules
* remove tryPreload
* fix comment
* fix var name
* fix lint
* fix L1 miss data && data condition
* fix comment