OpenAtomFoundation / xupercore

The kernel of xuperchain.
Apache License 2.0
61 stars 47 forks source link

fix consensus upgrade bugs #312

Closed qizheng09 closed 2 years ago

qizheng09 commented 2 years ago

Description

What is the purpose of the change? This pull request used to fix bugs consensus while upgrade.

Type of change

Please delete options that are not relevant.

Brief of your solution

Please describe your solution to solve the issue or feature request.

  1. Consensus can not upgrade to pow;
  2. Consensus startHeight equal to triggerHeight+1;
  3. Use SwitchConsensus while consensus upgrade;
  4. Consensus will not start until to height >= Consensus startHeight.
codecov-commenter commented 2 years ago

Codecov Report

Merging #312 (0c9a01d) into master (11ad7c3) will decrease coverage by 0.66%. The diff coverage is 28.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #312      +/-   ##
==========================================
- Coverage   46.46%   45.79%   -0.67%     
==========================================
  Files         136      138       +2     
  Lines       12197    12264      +67     
==========================================
- Hits         5667     5616      -51     
- Misses       5357     5494     +137     
+ Partials     1173     1154      -19     
Impacted Files Coverage Δ
bcs/consensus/pow/pow.go 42.96% <ø> (ø)
bcs/consensus/single/single.go 48.10% <ø> (ø)
kernel/consensus/pluggable_consensus.go 18.21% <14.58%> (-26.43%) :arrow_down:
kernel/consensus/step_consensus.go 30.43% <30.43%> (ø)
kernel/consensus/consensus_factory.go 30.76% <30.76%> (ø)
bcs/consensus/xpoa/xpoa.go 51.26% <46.87%> (-4.18%) :arrow_down:
bcs/consensus/tdpos/tdpos.go 48.34% <47.05%> (-1.91%) :arrow_down:
bcs/network/p2pv2/server.go 51.33% <0.00%> (-1.07%) :arrow_down:
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 11ad7c3...0c9a01d. Read the comment docs.