iost-official / go-iost

Official Go implementation of the IOST blockchain
https://developers.iost.io/
GNU Lesser General Public License v3.0
564 stars 112 forks source link

Feature/zzhang/spv #1160

Closed lispc closed 4 years ago

codecov[bot] commented 4 years ago

Codecov Report

Merging #1160 into master will increase coverage by 0.11%. The diff coverage is 31.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1160      +/-   ##
==========================================
+ Coverage   36.28%   36.40%   +0.11%     
==========================================
  Files         109      109              
  Lines        7556     7493      -63     
==========================================
- Hits         2742     2728      -14     
+ Misses       4429     4379      -50     
- Partials      385      386       +1     
Impacted Files Coverage Δ
chainbase/block.go 0.00% <0.00%> (ø)
chainbase/chainbase.go 0.00% <0.00%> (ø)
common/config.go 0.00% <ø> (ø)
consensus/synchro/blockhash_sync.go 81.55% <ø> (ø)
consensus/synchro/sync.go 81.88% <ø> (ø)
p2p/admin_server.go 0.00% <0.00%> (ø)
p2p/peer_manager.go 0.00% <0.00%> (ø)
core/blockcache/block_cache.go 36.57% <24.00%> (-1.89%) :arrow_down:
core/blockcache/set.go 50.00% <50.00%> (ø)
core/block/block.go 81.90% <75.00%> (+0.17%) :arrow_up:
... and 5 more
jerkyrs commented 4 years ago

Spv pending producer?

lispc commented 4 years ago

Light client: You start sync at block N*1200 ( in the block receipts, you can collect 'currentProducers' and 'pendingProdcuers', you check every block then to have more than 2/3 of producer signatures. Once the block at N1200 becomes finality ( more than 2/3 producers confirmed it), you switch producer list from 'currentProducers' to 'pendingProducers'. You repeat this until you reach block at (N+1)1200. Then jump to begin, repeat above process.

lispc commented 4 years ago

So your node can verify the blockchain status without even using vm to execute javascript.