Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f2b98abb2 | ||
|
|
55ef216c66 | ||
|
|
b679ba81f2 | ||
|
|
4feb52e5b0 | ||
|
|
5b5abc4e22 | ||
|
|
717b38c5f5 | ||
|
|
0f5a4c87db | ||
|
|
15bc2548c1 |
186
CHANGELOG.md
186
CHANGELOG.md
@@ -1,11 +1,23 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v1.1.10
|
||||||
|
|
||||||
|
FEATURE
|
||||||
|
* [\#885](https://github.com/bnb-chain/bsc/pull/885) add Euler Hardfork, including BEP-127 and BEP-131
|
||||||
|
|
||||||
|
|
||||||
|
BUGFIX
|
||||||
|
* [\#856](https://github.com/bnb-chain/bsc/pull/856) fix logic issue: handlers.removePeer() is called twice
|
||||||
|
* [\#860](https://github.com/bnb-chain/bsc/pull/860) fix:defer bloomprocessor close
|
||||||
|
* [\#877](https://github.com/bnb-chain/bsc/pull/877) fix validator pipecommit issue
|
||||||
|
* [\#870](https://github.com/bnb-chain/bsc/pull/870) fix:Shift panic for zero length of heads
|
||||||
|
|
||||||
## v1.1.9
|
## v1.1.9
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#792](https://github.com/binance-chain/bsc/pull/792) add shared storage for prefetching state data
|
* [\#792](https://github.com/bnb-chain/bsc/pull/792) add shared storage for prefetching state data
|
||||||
* [\#795](https://github.com/binance-chain/bsc/pull/795) implement state verification pipeline in pipecommit
|
* [\#795](https://github.com/bnb-chain/bsc/pull/795) implement state verification pipeline in pipecommit
|
||||||
* [\#803](https://github.com/binance-chain/bsc/pull/803) prefetch state data during the mining process
|
* [\#803](https://github.com/bnb-chain/bsc/pull/803) prefetch state data during the mining process
|
||||||
* [\#812](https://github.com/bnb-chain/bsc/pull/812) skip verification on account storage root to tolerate with fastnode when doing diffsync
|
* [\#812](https://github.com/bnb-chain/bsc/pull/812) skip verification on account storage root to tolerate with fastnode when doing diffsync
|
||||||
* [\#818](https://github.com/bnb-chain/bsc/pull/818) add shared storage to the prefetcher of miner
|
* [\#818](https://github.com/bnb-chain/bsc/pull/818) add shared storage to the prefetcher of miner
|
||||||
* [\#820](https://github.com/bnb-chain/bsc/pull/820) disable diffsync when pipecommit is enabled
|
* [\#820](https://github.com/bnb-chain/bsc/pull/820) disable diffsync when pipecommit is enabled
|
||||||
@@ -21,195 +33,195 @@ BUGFIX
|
|||||||
|
|
||||||
## v1.1.8
|
## v1.1.8
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#668](https://github.com/binance-chain/bsc/pull/668) implement State Verification && Snapshot Commit pipeline
|
* [\#668](https://github.com/bnb-chain/bsc/pull/668) implement State Verification && Snapshot Commit pipeline
|
||||||
* [\#581](https://github.com/binance-chain/bsc/pull/581) implement geth native trace
|
* [\#581](https://github.com/bnb-chain/bsc/pull/581) implement geth native trace
|
||||||
* [\#543](https://github.com/binance-chain/bsc/pull/543) implement offline block prune tools
|
* [\#543](https://github.com/bnb-chain/bsc/pull/543) implement offline block prune tools
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#704](https://github.com/binance-chain/bsc/pull/704) prefetch state by applying the transactions within one block
|
* [\#704](https://github.com/bnb-chain/bsc/pull/704) prefetch state by applying the transactions within one block
|
||||||
* [\#713](https://github.com/binance-chain/bsc/pull/713) add ARM binaries for release pipeline
|
* [\#713](https://github.com/bnb-chain/bsc/pull/713) add ARM binaries for release pipeline
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#667](https://github.com/binance-chain/bsc/pull/667) trie: reject deletions when verifying range proofs #667
|
* [\#667](https://github.com/bnb-chain/bsc/pull/667) trie: reject deletions when verifying range proofs #667
|
||||||
* [\#643](https://github.com/binance-chain/bsc/pull/643) add timeout for stopping p2p server to fix can not gracefully shutdown issue
|
* [\#643](https://github.com/bnb-chain/bsc/pull/643) add timeout for stopping p2p server to fix can not gracefully shutdown issue
|
||||||
* [\#740](https://github.com/binance-chain/bsc/pull/740) update discord link which won't expire
|
* [\#740](https://github.com/bnb-chain/bsc/pull/740) update discord link which won't expire
|
||||||
|
|
||||||
## v1.1.7
|
## v1.1.7
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#628](https://github.com/binance-chain/bsc/pull/628) fix state inconsistent when doing diffsync
|
* [\#628](https://github.com/bnb-chain/bsc/pull/628) fix state inconsistent when doing diffsync
|
||||||
|
|
||||||
## v1.1.6
|
## v1.1.6
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#582](https://github.com/binance-chain/bsc/pull/582) the DoS vulnerabilities fixed in go-ethereum v1.10.9
|
* [\#582](https://github.com/bnb-chain/bsc/pull/582) the DoS vulnerabilities fixed in go-ethereum v1.10.9
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#578](https://github.com/binance-chain/bsc/pull/578) reduce memory allocation and upgrade snappy version
|
* [\#578](https://github.com/bnb-chain/bsc/pull/578) reduce memory allocation and upgrade snappy version
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#570](https://github.com/binance-chain/bsc/pull/570) reannounce local pending transactions
|
* [\#570](https://github.com/bnb-chain/bsc/pull/570) reannounce local pending transactions
|
||||||
|
|
||||||
## v1.1.5
|
## v1.1.5
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#509](https://github.com/binance-chain/bsc/pull/509) fix graceful shutdown bug
|
* [\#509](https://github.com/bnb-chain/bsc/pull/509) fix graceful shutdown bug
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#536](https://github.com/binance-chain/bsc/pull/536) get diff accounts by replaying block when diff layer not found
|
* [\#536](https://github.com/bnb-chain/bsc/pull/536) get diff accounts by replaying block when diff layer not found
|
||||||
* [\#527](https://github.com/binance-chain/bsc/pull/527) improve diffsync protocol in many aspects
|
* [\#527](https://github.com/bnb-chain/bsc/pull/527) improve diffsync protocol in many aspects
|
||||||
* [\#493](https://github.com/binance-chain/bsc/pull/493) implement fast getDiffAccountsWithScope API
|
* [\#493](https://github.com/bnb-chain/bsc/pull/493) implement fast getDiffAccountsWithScope API
|
||||||
|
|
||||||
## v1.1.4
|
## v1.1.4
|
||||||
Improvement
|
Improvement
|
||||||
* [\#472](https://github.com/binance-chain/bsc/pull/472) add metrics for contract code bitmap cache
|
* [\#472](https://github.com/bnb-chain/bsc/pull/472) add metrics for contract code bitmap cache
|
||||||
* [\#473](https://github.com/binance-chain/bsc/pull/473) fix ci test flow
|
* [\#473](https://github.com/bnb-chain/bsc/pull/473) fix ci test flow
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#491](https://github.com/binance-chain/bsc/pull/491) fix prefetcher related bugs
|
* [\#491](https://github.com/bnb-chain/bsc/pull/491) fix prefetcher related bugs
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#480](https://github.com/binance-chain/bsc/pull/480) implement bep 95
|
* [\#480](https://github.com/bnb-chain/bsc/pull/480) implement bep 95
|
||||||
|
|
||||||
|
|
||||||
## v1.1.3
|
## v1.1.3
|
||||||
Improvement
|
Improvement
|
||||||
* [\#456](https://github.com/binance-chain/bsc/pull/456) git-flow support lint, unit test, and integration test
|
* [\#456](https://github.com/bnb-chain/bsc/pull/456) git-flow support lint, unit test, and integration test
|
||||||
* [\#449](https://github.com/binance-chain/bsc/pull/449) cache bitmap and change the cache type of GetCode
|
* [\#449](https://github.com/bnb-chain/bsc/pull/449) cache bitmap and change the cache type of GetCode
|
||||||
* [\#454](https://github.com/binance-chain/bsc/pull/454) fix cache key do not have hash func
|
* [\#454](https://github.com/bnb-chain/bsc/pull/454) fix cache key do not have hash func
|
||||||
* [\#446](https://github.com/binance-chain/bsc/pull/446) parallel bloom calculation
|
* [\#446](https://github.com/bnb-chain/bsc/pull/446) parallel bloom calculation
|
||||||
* [\#442](https://github.com/binance-chain/bsc/pull/442) ignore empty tx in GetDiffAccountsWithScope
|
* [\#442](https://github.com/bnb-chain/bsc/pull/442) ignore empty tx in GetDiffAccountsWithScope
|
||||||
* [\#426](https://github.com/binance-chain/bsc/pull/426) add block proccess backoff time when validator is not in turn and received in turn block
|
* [\#426](https://github.com/bnb-chain/bsc/pull/426) add block proccess backoff time when validator is not in turn and received in turn block
|
||||||
* [\#398](https://github.com/binance-chain/bsc/pull/398) ci pipeline for release page
|
* [\#398](https://github.com/bnb-chain/bsc/pull/398) ci pipeline for release page
|
||||||
|
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#446](https://github.com/binance-chain/bsc/pull/446) fix concurrent write of subfetcher
|
* [\#446](https://github.com/bnb-chain/bsc/pull/446) fix concurrent write of subfetcher
|
||||||
* [\#444](https://github.com/binance-chain/bsc/pull/444) fix blockhash not correct for the logs of system tx receipt
|
* [\#444](https://github.com/bnb-chain/bsc/pull/444) fix blockhash not correct for the logs of system tx receipt
|
||||||
* [\#409](https://github.com/binance-chain/bsc/pull/409) fix nil point in downloader
|
* [\#409](https://github.com/bnb-chain/bsc/pull/409) fix nil point in downloader
|
||||||
* [\#408](https://github.com/binance-chain/bsc/pull/408) core/state/snapshot: fix typo
|
* [\#408](https://github.com/bnb-chain/bsc/pull/408) core/state/snapshot: fix typo
|
||||||
|
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#431](https://github.com/binance-chain/bsc/pull/431) Export get diff accounts in block api
|
* [\#431](https://github.com/bnb-chain/bsc/pull/431) Export get diff accounts in block api
|
||||||
* [\#412](https://github.com/binance-chain/bsc/pull/412) add extension in eth protocol handshake to disable tx broadcast
|
* [\#412](https://github.com/bnb-chain/bsc/pull/412) add extension in eth protocol handshake to disable tx broadcast
|
||||||
* [\#376](https://github.com/binance-chain/bsc/pull/376) implement diff sync
|
* [\#376](https://github.com/bnb-chain/bsc/pull/376) implement diff sync
|
||||||
|
|
||||||
## v1.1.2
|
## v1.1.2
|
||||||
Security
|
Security
|
||||||
* [\#379](https://github.com/binance-chain/bsc/pull/379) A pre-announced hotfix release to patch a vulnerability in the EVM (CVE-2021-39137).
|
* [\#379](https://github.com/bnb-chain/bsc/pull/379) A pre-announced hotfix release to patch a vulnerability in the EVM (CVE-2021-39137).
|
||||||
|
|
||||||
|
|
||||||
## v1.1.1
|
## v1.1.1
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#355](https://github.com/binance-chain/bsc/pull/355) miner should propose block on a proper fork
|
* [\#355](https://github.com/bnb-chain/bsc/pull/355) miner should propose block on a proper fork
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#350](https://github.com/binance-chain/bsc/pull/350) flag: fix TriesInmemory specified but not work
|
* [\#350](https://github.com/bnb-chain/bsc/pull/350) flag: fix TriesInmemory specified but not work
|
||||||
* [\#358](https://github.com/binance-chain/bsc/pull/358) miner: fix null pending block
|
* [\#358](https://github.com/bnb-chain/bsc/pull/358) miner: fix null pending block
|
||||||
* [\#360](https://github.com/binance-chain/bsc/pull/360) pruner: fix state bloom sync permission in Windows
|
* [\#360](https://github.com/bnb-chain/bsc/pull/360) pruner: fix state bloom sync permission in Windows
|
||||||
* [\#366](https://github.com/binance-chain/bsc/pull/366) fix double close channel of subfetcher
|
* [\#366](https://github.com/bnb-chain/bsc/pull/366) fix double close channel of subfetcher
|
||||||
|
|
||||||
|
|
||||||
## v1.1.1-beta
|
## v1.1.1-beta
|
||||||
* [\#333](https://github.com/binance-chain/bsc/pull/333) improve block fetcher efficiency
|
* [\#333](https://github.com/bnb-chain/bsc/pull/333) improve block fetcher efficiency
|
||||||
* [\#326](https://github.com/binance-chain/bsc/pull/326) eth/tracers: improve tracing performance
|
* [\#326](https://github.com/bnb-chain/bsc/pull/326) eth/tracers: improve tracing performance
|
||||||
* [\#257](https://github.com/binance-chain/bsc/pull/257) performance improvement in many aspects
|
* [\#257](https://github.com/bnb-chain/bsc/pull/257) performance improvement in many aspects
|
||||||
|
|
||||||
|
|
||||||
## v1.1.0
|
## v1.1.0
|
||||||
* [\#282](https://github.com/binance-chain/bsc/pull/282) update discord link
|
* [\#282](https://github.com/bnb-chain/bsc/pull/282) update discord link
|
||||||
* [\#280](https://github.com/binance-chain/bsc/pull/280) update discord link
|
* [\#280](https://github.com/bnb-chain/bsc/pull/280) update discord link
|
||||||
* [\#227](https://github.com/binance-chain/bsc/pull/227) use more aggressive write cache policy
|
* [\#227](https://github.com/bnb-chain/bsc/pull/227) use more aggressive write cache policy
|
||||||
|
|
||||||
## v1.1.0-beta
|
## v1.1.0-beta
|
||||||
* [\#152](https://github.com/binance-chain/bsc/pull/152) upgrade to go-ethereum 1.10.3
|
* [\#152](https://github.com/bnb-chain/bsc/pull/152) upgrade to go-ethereum 1.10.3
|
||||||
|
|
||||||
## v1.0.7-hf.2
|
## v1.0.7-hf.2
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#194](https://github.com/binance-chain/bsc/pull/194) bump btcd to v0.20.1-beta
|
* [\#194](https://github.com/bnb-chain/bsc/pull/194) bump btcd to v0.20.1-beta
|
||||||
|
|
||||||
## v1.0.7-hf.1
|
## v1.0.7-hf.1
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#190](https://github.com/binance-chain/bsc/pull/190) fix disk increase dramaticly
|
* [\#190](https://github.com/bnb-chain/bsc/pull/190) fix disk increase dramaticly
|
||||||
* [\#191](https://github.com/binance-chain/bsc/pull/191) fix the reorg routine of tx pool stuck issue
|
* [\#191](https://github.com/bnb-chain/bsc/pull/191) fix the reorg routine of tx pool stuck issue
|
||||||
|
|
||||||
## v1.0.7
|
## v1.0.7
|
||||||
* [\#120](https://github.com/binance-chain/bsc/pull/120) add health check endpoint
|
* [\#120](https://github.com/bnb-chain/bsc/pull/120) add health check endpoint
|
||||||
* [\#116](https://github.com/binance-chain/bsc/pull/116) validator only write database state when enough distance
|
* [\#116](https://github.com/bnb-chain/bsc/pull/116) validator only write database state when enough distance
|
||||||
* [\#115](https://github.com/binance-chain/bsc/pull/115) add batch query methods
|
* [\#115](https://github.com/bnb-chain/bsc/pull/115) add batch query methods
|
||||||
* [\#112](https://github.com/binance-chain/bsc/pull/112) apply max commit tx time for miner worker to avoid empty block
|
* [\#112](https://github.com/bnb-chain/bsc/pull/112) apply max commit tx time for miner worker to avoid empty block
|
||||||
* [\#101](https://github.com/binance-chain/bsc/pull/101) apply block number limit for the `eth_getLogs` api
|
* [\#101](https://github.com/bnb-chain/bsc/pull/101) apply block number limit for the `eth_getLogs` api
|
||||||
* [\#99](https://github.com/binance-chain/bsc/pull/99) enable directbroadcast flag to decrease the block propagation time
|
* [\#99](https://github.com/bnb-chain/bsc/pull/99) enable directbroadcast flag to decrease the block propagation time
|
||||||
* [\#90](https://github.com/binance-chain/bsc/pull/90) add tini in docker image
|
* [\#90](https://github.com/bnb-chain/bsc/pull/90) add tini in docker image
|
||||||
* [\#84](https://github.com/binance-chain/bsc/pull/84) add jq in docker image
|
* [\#84](https://github.com/bnb-chain/bsc/pull/84) add jq in docker image
|
||||||
|
|
||||||
|
|
||||||
## v1.0.6
|
## v1.0.6
|
||||||
* [\#68](https://github.com/binance-chain/bsc/pull/68) apply mirror sync upgrade on mainnet
|
* [\#68](https://github.com/bnb-chain/bsc/pull/68) apply mirror sync upgrade on mainnet
|
||||||
|
|
||||||
## v1.0.5
|
## v1.0.5
|
||||||
|
|
||||||
SECURITY
|
SECURITY
|
||||||
* [\#63](https://github.com/binance-chain/bsc/pull/63) security patches from go-ethereum
|
* [\#63](https://github.com/bnb-chain/bsc/pull/63) security patches from go-ethereum
|
||||||
* [\#54](https://github.com/binance-chain/bsc/pull/54) les: fix GetProofsV2 that could potentially cause a panic.
|
* [\#54](https://github.com/bnb-chain/bsc/pull/54) les: fix GetProofsV2 that could potentially cause a panic.
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#56](https://github.com/binance-chain/bsc/pull/56) apply mirror sync upgrade
|
* [\#56](https://github.com/bnb-chain/bsc/pull/56) apply mirror sync upgrade
|
||||||
* [\#53](https://github.com/binance-chain/bsc/pull/53) support fork id in header; elegant upgrade
|
* [\#53](https://github.com/bnb-chain/bsc/pull/53) support fork id in header; elegant upgrade
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#61](https://github.com/binance-chain/bsc/pull/61)Add `x-forward-for` log message when handle message failed
|
* [\#61](https://github.com/bnb-chain/bsc/pull/61)Add `x-forward-for` log message when handle message failed
|
||||||
* [\#60](https://github.com/binance-chain/bsc/pull/61) add rpc method request gauge
|
* [\#60](https://github.com/bnb-chain/bsc/pull/61) add rpc method request gauge
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#59](https://github.com/binance-chain/bsc/pull/59) fix potential deadlock of pub/sub module
|
* [\#59](https://github.com/bnb-chain/bsc/pull/59) fix potential deadlock of pub/sub module
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## v1.0.4
|
## v1.0.4
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#35](https://github.com/binance-chain/bsc/pull/35) use fixed gas price when network is idle
|
* [\#35](https://github.com/bnb-chain/bsc/pull/35) use fixed gas price when network is idle
|
||||||
* [\#38](https://github.com/binance-chain/bsc/pull/38) disable noisy log from consensus engine
|
* [\#38](https://github.com/bnb-chain/bsc/pull/38) disable noisy log from consensus engine
|
||||||
* [\#47](https://github.com/binance-chain/bsc/pull/47) upgrade to golang1.15.5
|
* [\#47](https://github.com/bnb-chain/bsc/pull/47) upgrade to golang1.15.5
|
||||||
* [\#49](https://github.com/binance-chain/bsc/pull/49) Create pull request template for all developer to follow
|
* [\#49](https://github.com/bnb-chain/bsc/pull/49) Create pull request template for all developer to follow
|
||||||
|
|
||||||
|
|
||||||
## v1.0.3
|
## v1.0.3
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#36](https://github.com/binance-chain/bsc/pull/36) add max gas allwance calculation
|
* [\#36](https://github.com/bnb-chain/bsc/pull/36) add max gas allwance calculation
|
||||||
|
|
||||||
## v1.0.2
|
## v1.0.2
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#29](https://github.com/binance-chain/bsc/pull/29) eth/tracers: revert reason in call_tracer + error for failed internal…
|
* [\#29](https://github.com/bnb-chain/bsc/pull/29) eth/tracers: revert reason in call_tracer + error for failed internal…
|
||||||
|
|
||||||
## v1.0.1-beta
|
## v1.0.1-beta
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#22](https://github.com/binance-chain/bsc/pull/22) resolve best practice advice
|
* [\#22](https://github.com/bnb-chain/bsc/pull/22) resolve best practice advice
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#23](https://github.com/binance-chain/bsc/pull/23) enforce backoff time for out-turn validator
|
* [\#23](https://github.com/bnb-chain/bsc/pull/23) enforce backoff time for out-turn validator
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#25](https://github.com/binance-chain/bsc/pull/25) minor fix for ramanujan upgrade
|
* [\#25](https://github.com/bnb-chain/bsc/pull/25) minor fix for ramanujan upgrade
|
||||||
|
|
||||||
UPGRADE
|
UPGRADE
|
||||||
* [\#26](https://github.com/binance-chain/bsc/pull/26) update chapel network config for ramanujan fork
|
* [\#26](https://github.com/bnb-chain/bsc/pull/26) update chapel network config for ramanujan fork
|
||||||
|
|
||||||
## v1.0.0-beta.0
|
## v1.0.0-beta.0
|
||||||
|
|
||||||
FEATURES
|
FEATURES
|
||||||
* [\#5](https://github.com/binance-chain/bsc/pull/5) enable bep2e tokens for faucet
|
* [\#5](https://github.com/bnb-chain/bsc/pull/5) enable bep2e tokens for faucet
|
||||||
* [\#14](https://github.com/binance-chain/bsc/pull/14) add cross chain contract to system contract
|
* [\#14](https://github.com/bnb-chain/bsc/pull/14) add cross chain contract to system contract
|
||||||
* [\#15](https://github.com/binance-chain/bsc/pull/15) Allow liveness slash fail
|
* [\#15](https://github.com/bnb-chain/bsc/pull/15) Allow liveness slash fail
|
||||||
|
|
||||||
IMPROVEMENT
|
IMPROVEMENT
|
||||||
* [\#11](https://github.com/binance-chain/bsc/pull/11) remove redundant gaslimit check
|
* [\#11](https://github.com/bnb-chain/bsc/pull/11) remove redundant gaslimit check
|
||||||
|
|
||||||
BUGFIX
|
BUGFIX
|
||||||
* [\#4](https://github.com/binance-chain/bsc/pull/4) fix validator failed to sync a block produced by itself
|
* [\#4](https://github.com/bnb-chain/bsc/pull/4) fix validator failed to sync a block produced by itself
|
||||||
* [\#6](https://github.com/binance-chain/bsc/pull/6) modify params for Parlia consensus with 21 validators
|
* [\#6](https://github.com/bnb-chain/bsc/pull/6) modify params for Parlia consensus with 21 validators
|
||||||
* [\#10](https://github.com/binance-chain/bsc/pull/10) add gas limit check in parlia implement
|
* [\#10](https://github.com/bnb-chain/bsc/pull/10) add gas limit check in parlia implement
|
||||||
* [\#13](https://github.com/binance-chain/bsc/pull/13) fix debug_traceTransaction crashed issue
|
* [\#13](https://github.com/bnb-chain/bsc/pull/13) fix debug_traceTransaction crashed issue
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ This command will:
|
|||||||
|
|
||||||
Steps:
|
Steps:
|
||||||
|
|
||||||
1. Download the binary, config and genesis files from [release](https://github.com/binance-chain/bsc/releases/download/v1.0.0-alpha.0/binary.zip), or compile the binary by `make geth`.
|
1. Download the binary, config and genesis files from [release](https://github.com/bnb-chain/bsc/releases/tag/v1.1.10), or compile the binary by `make geth`.
|
||||||
2. Init genesis state: `./geth --datadir node init genesis.json`.
|
2. Init genesis state: `./geth --datadir node init genesis.json`.
|
||||||
3. Start your fullnode: `./geth --config ./config.toml --datadir ./node`.
|
3. Start your fullnode: `./geth --config ./config.toml --datadir ./node`.
|
||||||
4. Or start a validator node: `./geth --config ./config.toml --datadir ./node -unlock ${validatorAddr} --mine --allow-insecure-unlock`. The ${validatorAddr} is the wallet account address of your running validator node.
|
4. Or start a validator node: `./geth --config ./config.toml --datadir ./node -unlock ${validatorAddr} --mine --allow-insecure-unlock`. The ${validatorAddr} is the wallet account address of your running validator node.
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -616,7 +616,7 @@ func (p *Parlia) Prepare(chain consensus.ChainHeaderReader, header *types.Header
|
|||||||
header.Extra = append(header.Extra, nextForkHash[:]...)
|
header.Extra = append(header.Extra, nextForkHash[:]...)
|
||||||
|
|
||||||
if number%p.config.Epoch == 0 {
|
if number%p.config.Epoch == 0 {
|
||||||
newValidators, err := p.getCurrentValidators(header.ParentHash)
|
newValidators, err := p.getCurrentValidators(header.ParentHash, new(big.Int).Sub(header.Number, common.Big1))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -662,7 +662,7 @@ func (p *Parlia) Finalize(chain consensus.ChainHeaderReader, header *types.Heade
|
|||||||
// If the block is a epoch end block, verify the validator list
|
// If the block is a epoch end block, verify the validator list
|
||||||
// The verification can only be done when the state is ready, it can't be done in VerifyHeader.
|
// The verification can only be done when the state is ready, it can't be done in VerifyHeader.
|
||||||
if header.Number.Uint64()%p.config.Epoch == 0 {
|
if header.Number.Uint64()%p.config.Epoch == 0 {
|
||||||
newValidators, err := p.getCurrentValidators(header.ParentHash)
|
newValidators, err := p.getCurrentValidators(header.ParentHash, new(big.Int).Sub(header.Number, common.Big1))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -997,12 +997,15 @@ func (p *Parlia) Close() error {
|
|||||||
// ========================== interaction with contract/account =========
|
// ========================== interaction with contract/account =========
|
||||||
|
|
||||||
// getCurrentValidators get current validators
|
// getCurrentValidators get current validators
|
||||||
func (p *Parlia) getCurrentValidators(blockHash common.Hash) ([]common.Address, error) {
|
func (p *Parlia) getCurrentValidators(blockHash common.Hash, blockNumber *big.Int) ([]common.Address, error) {
|
||||||
// block
|
// block
|
||||||
blockNr := rpc.BlockNumberOrHashWithHash(blockHash, false)
|
blockNr := rpc.BlockNumberOrHashWithHash(blockHash, false)
|
||||||
|
|
||||||
// method
|
// method
|
||||||
method := "getValidators"
|
method := "getValidators"
|
||||||
|
if p.chainConfig.IsEuler(blockNumber) {
|
||||||
|
method = "getMiningValidators"
|
||||||
|
}
|
||||||
|
|
||||||
ctx, cancel := context.WithCancel(context.Background())
|
ctx, cancel := context.WithCancel(context.Background())
|
||||||
defer cancel() // cancel when we are finished consuming integers
|
defer cancel() // cancel when we are finished consuming integers
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/common"
|
||||||
"github.com/ethereum/go-ethereum/consensus"
|
"github.com/ethereum/go-ethereum/consensus"
|
||||||
"github.com/ethereum/go-ethereum/core/state"
|
"github.com/ethereum/go-ethereum/core/state"
|
||||||
"github.com/ethereum/go-ethereum/core/types"
|
"github.com/ethereum/go-ethereum/core/types"
|
||||||
@@ -140,10 +141,8 @@ func (v *BlockValidator) ValidateState(block *types.Block, statedb *state.StateD
|
|||||||
if err := statedb.WaitPipeVerification(); err != nil {
|
if err := statedb.WaitPipeVerification(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
statedb.CorrectAccountsRoot()
|
statedb.CorrectAccountsRoot(common.Hash{})
|
||||||
statedb.Finalise(v.config.IsEIP158(header.Number))
|
statedb.Finalise(v.config.IsEIP158(header.Number))
|
||||||
// State verification pipeline - accounts root are not calculated here, just populate needed fields for process
|
|
||||||
statedb.PopulateSnapAccountAndStorage()
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -975,12 +975,23 @@ func (s *StateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//CorrectAccountsRoot will fix account roots in pipecommit mode
|
//CorrectAccountsRoot will fix account roots in pipecommit mode
|
||||||
func (s *StateDB) CorrectAccountsRoot() {
|
func (s *StateDB) CorrectAccountsRoot(blockRoot common.Hash) {
|
||||||
if accounts, err := s.snap.Accounts(); err == nil && accounts != nil {
|
var snapshot snapshot.Snapshot
|
||||||
|
if blockRoot == (common.Hash{}) {
|
||||||
|
snapshot = s.snap
|
||||||
|
} else if s.snaps != nil {
|
||||||
|
snapshot = s.snaps.Snapshot(blockRoot)
|
||||||
|
}
|
||||||
|
|
||||||
|
if snapshot == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if accounts, err := snapshot.Accounts(); err == nil && accounts != nil {
|
||||||
for _, obj := range s.stateObjects {
|
for _, obj := range s.stateObjects {
|
||||||
if !obj.deleted && !obj.rootCorrected && obj.data.Root == dummyRoot {
|
if !obj.deleted && !obj.rootCorrected && obj.data.Root == dummyRoot {
|
||||||
if account, exist := accounts[crypto.Keccak256Hash(obj.address[:])]; exist && len(account.Root) != 0 {
|
if account, exist := accounts[crypto.Keccak256Hash(obj.address[:])]; exist && len(account.Root) != 0 {
|
||||||
obj.data.Root = common.BytesToHash(account.Root)
|
obj.data.Root = common.BytesToHash(account.Root)
|
||||||
|
obj.rootCorrected = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1465,6 +1476,8 @@ func (s *StateDB) Commit(failPostCommitFunc func(), postCommitFuncs ...func() er
|
|||||||
}
|
}
|
||||||
if s.pipeCommit {
|
if s.pipeCommit {
|
||||||
defer close(snapUpdated)
|
defer close(snapUpdated)
|
||||||
|
// State verification pipeline - accounts root are not calculated here, just populate needed fields for process
|
||||||
|
s.PopulateSnapAccountAndStorage()
|
||||||
}
|
}
|
||||||
diffLayer.Destructs, diffLayer.Accounts, diffLayer.Storages = s.SnapToDiffLayer()
|
diffLayer.Destructs, diffLayer.Accounts, diffLayer.Storages = s.SnapToDiffLayer()
|
||||||
// Only update if there's a state transition (skip empty Clique blocks)
|
// Only update if there's a state transition (skip empty Clique blocks)
|
||||||
|
|||||||
@@ -127,23 +127,21 @@ func (p *statePrefetcher) PrefetchMining(txs *types.TransactionsByPriceAndNonce,
|
|||||||
go func(txset *types.TransactionsByPriceAndNonce) {
|
go func(txset *types.TransactionsByPriceAndNonce) {
|
||||||
count := 0
|
count := 0
|
||||||
for {
|
for {
|
||||||
tx := txset.Peek()
|
|
||||||
if tx == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
select {
|
select {
|
||||||
case <-interruptCh:
|
case <-interruptCh:
|
||||||
return
|
return
|
||||||
default:
|
default:
|
||||||
}
|
|
||||||
if count++; count%checkInterval == 0 {
|
if count++; count%checkInterval == 0 {
|
||||||
if *txCurr == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
txset.Forward(*txCurr)
|
txset.Forward(*txCurr)
|
||||||
}
|
}
|
||||||
|
tx := txset.Peek()
|
||||||
|
if tx == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
txCh <- tx
|
txCh <- tx
|
||||||
txset.Shift()
|
txset.Shift()
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}(txs)
|
}(txs)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
|||||||
for i, tx := range block.Transactions() {
|
for i, tx := range block.Transactions() {
|
||||||
if isPoSA {
|
if isPoSA {
|
||||||
if isSystemTx, err := posa.IsSystemTransaction(tx, block.Header()); err != nil {
|
if isSystemTx, err := posa.IsSystemTransaction(tx, block.Header()); err != nil {
|
||||||
|
bloomProcessors.Close()
|
||||||
return statedb, nil, nil, 0, err
|
return statedb, nil, nil, 0, err
|
||||||
} else if isSystemTx {
|
} else if isSystemTx {
|
||||||
systemTxs = append(systemTxs, tx)
|
systemTxs = append(systemTxs, tx)
|
||||||
@@ -419,11 +420,13 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
|
|||||||
|
|
||||||
msg, err := tx.AsMessage(signer)
|
msg, err := tx.AsMessage(signer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
bloomProcessors.Close()
|
||||||
return statedb, nil, nil, 0, err
|
return statedb, nil, nil, 0, err
|
||||||
}
|
}
|
||||||
statedb.Prepare(tx.Hash(), block.Hash(), i)
|
statedb.Prepare(tx.Hash(), block.Hash(), i)
|
||||||
receipt, err := applyTransaction(msg, p.config, p.bc, nil, gp, statedb, header, tx, usedGas, vmenv, bloomProcessors)
|
receipt, err := applyTransaction(msg, p.config, p.bc, nil, gp, statedb, header, tx, usedGas, vmenv, bloomProcessors)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
bloomProcessors.Close()
|
||||||
return statedb, nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
|
return statedb, nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -506,7 +506,9 @@ func (t *TransactionsByPriceAndNonce) CurrentSize() int {
|
|||||||
//Forward moves current transaction to be the one which is one index after tx
|
//Forward moves current transaction to be the one which is one index after tx
|
||||||
func (t *TransactionsByPriceAndNonce) Forward(tx *Transaction) {
|
func (t *TransactionsByPriceAndNonce) Forward(tx *Transaction) {
|
||||||
if tx == nil {
|
if tx == nil {
|
||||||
|
if len(t.heads) > 0 {
|
||||||
t.heads = t.heads[0:0]
|
t.heads = t.heads[0:0]
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//check whether target tx exists in t.heads
|
//check whether target tx exists in t.heads
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ func TestTransactionForward(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tmp := txset.Copy()
|
tmp := txset.Copy()
|
||||||
for j := 0; j < 10; j++ {
|
for j := 0; j < 11; j++ {
|
||||||
txset = tmp.Copy()
|
txset = tmp.Copy()
|
||||||
txsetCpy = tmp.Copy()
|
txsetCpy = tmp.Copy()
|
||||||
i := 0
|
i := 0
|
||||||
@@ -400,6 +400,9 @@ func TestTransactionForward(t *testing.T) {
|
|||||||
txset.Shift()
|
txset.Shift()
|
||||||
}
|
}
|
||||||
tx := txset.Peek()
|
tx := txset.Peek()
|
||||||
|
if tx == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
txsetCpy.Forward(tx)
|
txsetCpy.Forward(tx)
|
||||||
txCpy := txsetCpy.Peek()
|
txCpy := txsetCpy.Peek()
|
||||||
if txCpy == nil {
|
if txCpy == nil {
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ func generateTestChainWithFork(n int, fork int) (*core.Genesis, []*types.Block,
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(0),
|
MirrorSyncBlock: big.NewInt(0),
|
||||||
BrunoBlock: big.NewInt(0),
|
BrunoBlock: big.NewInt(0),
|
||||||
|
EulerBlock: big.NewInt(0),
|
||||||
|
|
||||||
Ethash: new(params.EthashConfig),
|
Ethash: new(params.EthashConfig),
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ func (h *handler) runEthPeer(peer *eth.Peer, handler eth.Handler) error {
|
|||||||
peer.Log().Error("Ethereum peer registration failed", "err", err)
|
peer.Log().Error("Ethereum peer registration failed", "err", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer h.removePeer(peer.ID())
|
defer h.unregisterPeer(peer.ID())
|
||||||
|
|
||||||
p := h.peers.peer(peer.ID())
|
p := h.peers.peer(peer.ID())
|
||||||
if p == nil {
|
if p == nil {
|
||||||
@@ -395,9 +395,17 @@ func (h *handler) runDiffExtension(peer *diff.Peer, handler diff.Handler) error
|
|||||||
return handler(peer)
|
return handler(peer)
|
||||||
}
|
}
|
||||||
|
|
||||||
// removePeer unregisters a peer from the downloader and fetchers, removes it from
|
// removePeer requests disconnection of a peer.
|
||||||
// the set of tracked peers and closes the network connection to it.
|
|
||||||
func (h *handler) removePeer(id string) {
|
func (h *handler) removePeer(id string) {
|
||||||
|
peer := h.peers.peer(id)
|
||||||
|
if peer != nil {
|
||||||
|
// Hard disconnect at the networking layer. Handler will get an EOF and terminate the peer. defer unregisterPeer will do the cleanup task after then.
|
||||||
|
peer.Peer.Disconnect(p2p.DiscUselessPeer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// unregisterPeer removes a peer from the downloader, fetchers and main peer set.
|
||||||
|
func (h *handler) unregisterPeer(id string) {
|
||||||
// Create a custom logger to avoid printing the entire id
|
// Create a custom logger to avoid printing the entire id
|
||||||
var logger log.Logger
|
var logger log.Logger
|
||||||
if len(id) < 16 {
|
if len(id) < 16 {
|
||||||
@@ -425,8 +433,6 @@ func (h *handler) removePeer(id string) {
|
|||||||
if err := h.peers.unregisterPeer(id); err != nil {
|
if err := h.peers.unregisterPeer(id); err != nil {
|
||||||
logger.Error("Ethereum peer removal failed", "err", err)
|
logger.Error("Ethereum peer removal failed", "err", err)
|
||||||
}
|
}
|
||||||
// Hard disconnect at the networking layer
|
|
||||||
peer.Peer.Disconnect(p2p.DiscUselessPeer)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *handler) Start(maxPeers int) {
|
func (h *handler) Start(maxPeers int) {
|
||||||
|
|||||||
@@ -641,14 +641,20 @@ func testCheckpointChallenge(t *testing.T, syncmode downloader.SyncMode, checkpo
|
|||||||
defer p2pLocal.Close()
|
defer p2pLocal.Close()
|
||||||
defer p2pRemote.Close()
|
defer p2pRemote.Close()
|
||||||
|
|
||||||
local := eth.NewPeer(eth.ETH65, p2p.NewPeer(enode.ID{1}, "", nil), p2pLocal, handler.txpool)
|
local := eth.NewPeer(eth.ETH65, p2p.NewPeerPipe(enode.ID{1}, "", nil, p2pLocal), p2pLocal, handler.txpool)
|
||||||
remote := eth.NewPeer(eth.ETH65, p2p.NewPeer(enode.ID{2}, "", nil), p2pRemote, handler.txpool)
|
remote := eth.NewPeer(eth.ETH65, p2p.NewPeerPipe(enode.ID{2}, "", nil, p2pRemote), p2pRemote, handler.txpool)
|
||||||
defer local.Close()
|
defer local.Close()
|
||||||
defer remote.Close()
|
defer remote.Close()
|
||||||
|
|
||||||
go handler.handler.runEthPeer(local, func(peer *eth.Peer) error {
|
handlerDone := make(chan struct{})
|
||||||
return eth.Handle((*ethHandler)(handler.handler), peer)
|
go func() {
|
||||||
|
defer close(handlerDone)
|
||||||
|
handler.handler.runEthPeer(local, func(peer *eth.Peer) error {
|
||||||
|
err := eth.Handle((*ethHandler)(handler.handler), peer)
|
||||||
|
return err
|
||||||
})
|
})
|
||||||
|
}()
|
||||||
|
|
||||||
// Run the handshake locally to avoid spinning up a remote handler
|
// Run the handshake locally to avoid spinning up a remote handler
|
||||||
var (
|
var (
|
||||||
genesis = handler.chain.Genesis()
|
genesis = handler.chain.Genesis()
|
||||||
@@ -685,6 +691,7 @@ func testCheckpointChallenge(t *testing.T, syncmode downloader.SyncMode, checkpo
|
|||||||
|
|
||||||
// Verify that the remote peer is maintained or dropped
|
// Verify that the remote peer is maintained or dropped
|
||||||
if drop {
|
if drop {
|
||||||
|
<-handlerDone
|
||||||
if peers := handler.handler.peers.len(); peers != 0 {
|
if peers := handler.handler.peers.len(); peers != 0 {
|
||||||
t.Fatalf("peer count mismatch: have %d, want %d", peers, 0)
|
t.Fatalf("peer count mismatch: have %d, want %d", peers, 0)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -761,9 +761,14 @@ func (w *worker) commitTransactions(txs *types.TransactionsByPriceAndNonce, coin
|
|||||||
|
|
||||||
if w.current.gasPool == nil {
|
if w.current.gasPool == nil {
|
||||||
w.current.gasPool = new(core.GasPool).AddGas(w.current.header.GasLimit)
|
w.current.gasPool = new(core.GasPool).AddGas(w.current.header.GasLimit)
|
||||||
|
if w.chain.Config().IsEuler(w.current.header.Number) {
|
||||||
|
w.current.gasPool.SubGas(params.SystemTxsGas * 3)
|
||||||
|
} else {
|
||||||
w.current.gasPool.SubGas(params.SystemTxsGas)
|
w.current.gasPool.SubGas(params.SystemTxsGas)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
var coalescedLogs []*types.Log
|
var coalescedLogs []*types.Log
|
||||||
var stopTimer *time.Timer
|
var stopTimer *time.Timer
|
||||||
delay := w.engine.Delay(w.chain, w.current.header)
|
delay := w.engine.Delay(w.chain, w.current.header)
|
||||||
@@ -1009,6 +1014,9 @@ func (w *worker) commit(uncles []*types.Header, interval func(), update bool, st
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.CorrectAccountsRoot(w.chain.CurrentBlock().Root())
|
||||||
|
|
||||||
block, receipts, err := w.engine.FinalizeAndAssemble(w.chain, types.CopyHeader(w.current.header), s, w.current.txs, uncles, w.current.receipts)
|
block, receipts, err := w.engine.FinalizeAndAssemble(w.chain, types.CopyHeader(w.current.header), s, w.current.txs, uncles, w.current.receipts)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
14
p2p/peer.go
14
p2p/peer.go
@@ -117,6 +117,7 @@ type Peer struct {
|
|||||||
|
|
||||||
// events receives message send / receive events if set
|
// events receives message send / receive events if set
|
||||||
events *event.Feed
|
events *event.Feed
|
||||||
|
testPipe *MsgPipeRW // for testing
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewPeer returns a peer for testing purposes.
|
// NewPeer returns a peer for testing purposes.
|
||||||
@@ -129,6 +130,15 @@ func NewPeer(id enode.ID, name string, caps []Cap) *Peer {
|
|||||||
return peer
|
return peer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewPeerPipe creates a peer for testing purposes.
|
||||||
|
// The message pipe given as the last parameter is closed when
|
||||||
|
// Disconnect is called on the peer.
|
||||||
|
func NewPeerPipe(id enode.ID, name string, caps []Cap, pipe *MsgPipeRW) *Peer {
|
||||||
|
p := NewPeer(id, name, caps)
|
||||||
|
p.testPipe = pipe
|
||||||
|
return p
|
||||||
|
}
|
||||||
|
|
||||||
// NewPeerWithProtocols returns a peer for testing purposes.
|
// NewPeerWithProtocols returns a peer for testing purposes.
|
||||||
func NewPeerWithProtocols(id enode.ID, protocols []Protocol, name string, caps []Cap) *Peer {
|
func NewPeerWithProtocols(id enode.ID, protocols []Protocol, name string, caps []Cap) *Peer {
|
||||||
pipe, _ := net.Pipe()
|
pipe, _ := net.Pipe()
|
||||||
@@ -196,6 +206,10 @@ func (p *Peer) LocalAddr() net.Addr {
|
|||||||
// Disconnect terminates the peer connection with the given reason.
|
// Disconnect terminates the peer connection with the given reason.
|
||||||
// It returns immediately and does not wait until the connection is closed.
|
// It returns immediately and does not wait until the connection is closed.
|
||||||
func (p *Peer) Disconnect(reason DiscReason) {
|
func (p *Peer) Disconnect(reason DiscReason) {
|
||||||
|
if p.testPipe != nil {
|
||||||
|
p.testPipe.Close()
|
||||||
|
}
|
||||||
|
|
||||||
select {
|
select {
|
||||||
case p.disc <- reason:
|
case p.disc <- reason:
|
||||||
case <-p.closed:
|
case <-p.closed:
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ var (
|
|||||||
|
|
||||||
BSCGenesisHash = common.HexToHash("0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b")
|
BSCGenesisHash = common.HexToHash("0x0d21840abff46b96c84b2ac9e10e4f5cdaeb5693cb665db62a2f3b02d2d57b5b")
|
||||||
ChapelGenesisHash = common.HexToHash("0x6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34")
|
ChapelGenesisHash = common.HexToHash("0x6d3c66c5357ec91d5c43af47e234a939b22557cbb552dc45bebbceeed90fbe34")
|
||||||
RialtoGenesisHash = common.HexToHash("0xaabe549bfa85c84f7aee9da7010b97453ad686f2c2d8ce00503d1a00c72cad54")
|
RialtoGenesisHash = common.HexToHash("0xee835a629f9cf5510b48b6ba41d69e0ff7d6ef10f977166ef939db41f59f5501")
|
||||||
YoloV3GenesisHash = common.HexToHash("0xf1f2876e8500c77afcc03228757b39477eceffccf645b734967fe3c7e16967b7")
|
YoloV3GenesisHash = common.HexToHash("0xf1f2876e8500c77afcc03228757b39477eceffccf645b734967fe3c7e16967b7")
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -76,6 +76,7 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(0),
|
MirrorSyncBlock: big.NewInt(0),
|
||||||
BrunoBlock: big.NewInt(0),
|
BrunoBlock: big.NewInt(0),
|
||||||
|
EulerBlock: big.NewInt(0),
|
||||||
BerlinBlock: big.NewInt(12_244_000),
|
BerlinBlock: big.NewInt(12_244_000),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
@@ -120,6 +121,7 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(0),
|
MirrorSyncBlock: big.NewInt(0),
|
||||||
BrunoBlock: big.NewInt(0),
|
BrunoBlock: big.NewInt(0),
|
||||||
|
EulerBlock: big.NewInt(0),
|
||||||
BerlinBlock: big.NewInt(9_812_189),
|
BerlinBlock: big.NewInt(9_812_189),
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
@@ -164,6 +166,7 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(0),
|
MirrorSyncBlock: big.NewInt(0),
|
||||||
BrunoBlock: big.NewInt(0),
|
BrunoBlock: big.NewInt(0),
|
||||||
|
EulerBlock: big.NewInt(0),
|
||||||
BerlinBlock: big.NewInt(8_290_928),
|
BerlinBlock: big.NewInt(8_290_928),
|
||||||
Clique: &CliqueConfig{
|
Clique: &CliqueConfig{
|
||||||
Period: 15,
|
Period: 15,
|
||||||
@@ -207,6 +210,7 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(0),
|
MirrorSyncBlock: big.NewInt(0),
|
||||||
BrunoBlock: big.NewInt(0),
|
BrunoBlock: big.NewInt(0),
|
||||||
|
EulerBlock: big.NewInt(0),
|
||||||
IstanbulBlock: big.NewInt(1_561_651),
|
IstanbulBlock: big.NewInt(1_561_651),
|
||||||
MuirGlacierBlock: nil,
|
MuirGlacierBlock: nil,
|
||||||
BerlinBlock: big.NewInt(4_460_644),
|
BerlinBlock: big.NewInt(4_460_644),
|
||||||
@@ -251,6 +255,10 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(5184000),
|
MirrorSyncBlock: big.NewInt(5184000),
|
||||||
BrunoBlock: big.NewInt(13082000),
|
BrunoBlock: big.NewInt(13082000),
|
||||||
|
|
||||||
|
// TODO modify blockNumber
|
||||||
|
EulerBlock: nil,
|
||||||
|
|
||||||
Parlia: &ParliaConfig{
|
Parlia: &ParliaConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
Epoch: 200,
|
Epoch: 200,
|
||||||
@@ -272,6 +280,8 @@ var (
|
|||||||
NielsBlock: big.NewInt(1014369),
|
NielsBlock: big.NewInt(1014369),
|
||||||
MirrorSyncBlock: big.NewInt(5582500),
|
MirrorSyncBlock: big.NewInt(5582500),
|
||||||
BrunoBlock: big.NewInt(13837000),
|
BrunoBlock: big.NewInt(13837000),
|
||||||
|
EulerBlock: big.NewInt(19203503),
|
||||||
|
|
||||||
Parlia: &ParliaConfig{
|
Parlia: &ParliaConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
Epoch: 200,
|
Epoch: 200,
|
||||||
@@ -293,6 +303,10 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(400),
|
MirrorSyncBlock: big.NewInt(400),
|
||||||
BrunoBlock: big.NewInt(400),
|
BrunoBlock: big.NewInt(400),
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
EulerBlock: nil,
|
||||||
|
|
||||||
Parlia: &ParliaConfig{
|
Parlia: &ParliaConfig{
|
||||||
Period: 3,
|
Period: 3,
|
||||||
Epoch: 200,
|
Epoch: 200,
|
||||||
@@ -316,6 +330,7 @@ var (
|
|||||||
NielsBlock: big.NewInt(0),
|
NielsBlock: big.NewInt(0),
|
||||||
MirrorSyncBlock: big.NewInt(0),
|
MirrorSyncBlock: big.NewInt(0),
|
||||||
BrunoBlock: big.NewInt(0),
|
BrunoBlock: big.NewInt(0),
|
||||||
|
EulerBlock: big.NewInt(0),
|
||||||
MuirGlacierBlock: nil,
|
MuirGlacierBlock: nil,
|
||||||
BerlinBlock: nil, // Don't enable Berlin directly, we're YOLOing it
|
BerlinBlock: nil, // Don't enable Berlin directly, we're YOLOing it
|
||||||
YoloV3Block: big.NewInt(0),
|
YoloV3Block: big.NewInt(0),
|
||||||
@@ -330,16 +345,16 @@ var (
|
|||||||
//
|
//
|
||||||
// This configuration is intentionally not using keyed fields to force anyone
|
// This configuration is intentionally not using keyed fields to force anyone
|
||||||
// adding flags to the config to also have to set these fields.
|
// adding flags to the config to also have to set these fields.
|
||||||
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil, nil}
|
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil, nil}
|
||||||
|
|
||||||
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
||||||
// and accepted by the Ethereum core developers into the Clique consensus.
|
// and accepted by the Ethereum core developers into the Clique consensus.
|
||||||
//
|
//
|
||||||
// This configuration is intentionally not using keyed fields to force anyone
|
// This configuration is intentionally not using keyed fields to force anyone
|
||||||
// adding flags to the config to also have to set these fields.
|
// adding flags to the config to also have to set these fields.
|
||||||
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil}
|
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, &CliqueConfig{Period: 0, Epoch: 30000}, nil}
|
||||||
|
|
||||||
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil, nil}
|
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), nil, nil, nil, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), new(EthashConfig), nil, nil}
|
||||||
|
|
||||||
TestRules = TestChainConfig.Rules(new(big.Int))
|
TestRules = TestChainConfig.Rules(new(big.Int))
|
||||||
)
|
)
|
||||||
@@ -427,6 +442,7 @@ type ChainConfig struct {
|
|||||||
NielsBlock *big.Int `json:"nielsBlock,omitempty" toml:",omitempty"` // nielsBlock switch block (nil = no fork, 0 = already activated)
|
NielsBlock *big.Int `json:"nielsBlock,omitempty" toml:",omitempty"` // nielsBlock switch block (nil = no fork, 0 = already activated)
|
||||||
MirrorSyncBlock *big.Int `json:"mirrorSyncBlock,omitempty" toml:",omitempty"` // mirrorSyncBlock switch block (nil = no fork, 0 = already activated)
|
MirrorSyncBlock *big.Int `json:"mirrorSyncBlock,omitempty" toml:",omitempty"` // mirrorSyncBlock switch block (nil = no fork, 0 = already activated)
|
||||||
BrunoBlock *big.Int `json:"brunoBlock,omitempty" toml:",omitempty"` // brunoBlock switch block (nil = no fork, 0 = already activated)
|
BrunoBlock *big.Int `json:"brunoBlock,omitempty" toml:",omitempty"` // brunoBlock switch block (nil = no fork, 0 = already activated)
|
||||||
|
EulerBlock *big.Int `json:"eulerBlock,omitempty" toml:",omitempty"` // eulerBlock switch block (nil = no fork, 0 = already activated)
|
||||||
|
|
||||||
// Various consensus engines
|
// Various consensus engines
|
||||||
Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
|
Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
|
||||||
@@ -477,7 +493,7 @@ func (c *ChainConfig) String() string {
|
|||||||
default:
|
default:
|
||||||
engine = "unknown"
|
engine = "unknown"
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, Engine: %v}",
|
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, Euler: %v, Engine: %v}",
|
||||||
c.ChainID,
|
c.ChainID,
|
||||||
c.HomesteadBlock,
|
c.HomesteadBlock,
|
||||||
c.DAOForkBlock,
|
c.DAOForkBlock,
|
||||||
@@ -496,6 +512,7 @@ func (c *ChainConfig) String() string {
|
|||||||
c.BrunoBlock,
|
c.BrunoBlock,
|
||||||
c.BerlinBlock,
|
c.BerlinBlock,
|
||||||
c.YoloV3Block,
|
c.YoloV3Block,
|
||||||
|
c.EulerBlock,
|
||||||
engine,
|
engine,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -575,6 +592,16 @@ func (c *ChainConfig) IsOnBruno(num *big.Int) bool {
|
|||||||
return configNumEqual(c.BrunoBlock, num)
|
return configNumEqual(c.BrunoBlock, num)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsEuler returns whether num is either equal to the euler fork block or greater.
|
||||||
|
func (c *ChainConfig) IsEuler(num *big.Int) bool {
|
||||||
|
return isForked(c.EulerBlock, num)
|
||||||
|
}
|
||||||
|
|
||||||
|
// IsOnEuler returns whether num is equal to the euler fork block
|
||||||
|
func (c *ChainConfig) IsOnEuler(num *big.Int) bool {
|
||||||
|
return configNumEqual(c.EulerBlock, num)
|
||||||
|
}
|
||||||
|
|
||||||
// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
|
// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
|
||||||
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
|
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
|
||||||
return isForked(c.MuirGlacierBlock, num)
|
return isForked(c.MuirGlacierBlock, num)
|
||||||
@@ -637,6 +664,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
|
|||||||
for _, cur := range []fork{
|
for _, cur := range []fork{
|
||||||
{name: "mirrorSyncBlock", block: c.MirrorSyncBlock},
|
{name: "mirrorSyncBlock", block: c.MirrorSyncBlock},
|
||||||
{name: "brunoBlock", block: c.BrunoBlock},
|
{name: "brunoBlock", block: c.BrunoBlock},
|
||||||
|
{name: "eulerBlock", block: c.EulerBlock},
|
||||||
{name: "berlinBlock", block: c.BerlinBlock},
|
{name: "berlinBlock", block: c.BerlinBlock},
|
||||||
} {
|
} {
|
||||||
if lastFork.name != "" {
|
if lastFork.name != "" {
|
||||||
@@ -719,6 +747,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, head *big.Int) *Confi
|
|||||||
if isForkIncompatible(c.BrunoBlock, newcfg.BrunoBlock, head) {
|
if isForkIncompatible(c.BrunoBlock, newcfg.BrunoBlock, head) {
|
||||||
return newCompatError("bruno fork block", c.BrunoBlock, newcfg.BrunoBlock)
|
return newCompatError("bruno fork block", c.BrunoBlock, newcfg.BrunoBlock)
|
||||||
}
|
}
|
||||||
|
if isForkIncompatible(c.EulerBlock, newcfg.EulerBlock, head) {
|
||||||
|
return newCompatError("euler fork block", c.EulerBlock, newcfg.EulerBlock)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
VersionMajor = 1 // Major version component of the current release
|
VersionMajor = 1 // Major version component of the current release
|
||||||
VersionMinor = 1 // Minor version component of the current release
|
VersionMinor = 1 // Minor version component of the current release
|
||||||
VersionPatch = 9 // Patch version component of the current release
|
VersionPatch = 10 // Patch version component of the current release
|
||||||
VersionMeta = "" // Version metadata to append to the version string
|
VersionMeta = "" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user