Conversation
|
Would be useful to have a |
Codecov Report
@@ Coverage Diff @@
## master #3769 +/- ##
==========================================
- Coverage 64.98% 64.87% -0.11%
==========================================
Files 217 217
Lines 18211 18189 -22
==========================================
- Hits 11835 11801 -34
- Misses 5458 5470 +12
Partials 918 918
|
| [tendermint state sync proposal 2](https://docs.google.com/document/d/1npGTAa1qxe8EQZ1wG0a0Sip9t5oX2vYZNUDwr_LVRR4/edit) - ackratos proposal | ||
| [proposal 2 implementation](https://github.com/tendermint/tendermint/pull/3243) - ackratos implementation | ||
| [WIP General/Lazy State-Sync pseudo-spec](https://github.com/tendermint/tendermint/issues/3639) - Jae Proposal | ||
| [Warp Sync Implementation](https://github.com/tendermint/tendermint/pull/3594) - ackratos |
There was a problem hiding this comment.
we have some more stuff:
- document for this enhancement: [R4R] BEP-18: for state sync enhancement bnb-chain/BEPs#18, included more chunking strategy we adopted
- to try out state sync in binance chain prod and testnet: https://github.com/binance-chain/docs-site/blob/master/docs/fullnode.md#state-sync
| [#3639](https://github.com/tendermint/tendermint/issues/3639) where chunking | ||
| happens lazily and in a dynamic way: nodes request key ranges from their peers, | ||
| and peers respond with some subset of the | ||
| requested range and with notes on how to request the rest in parallel from other |
There was a problem hiding this comment.
This part of this design is super tricky to implement correctly in my view as we ask set of peers and each of them come back with notes how to download rest.
Is this what you had in mind @AdityaSripal ? |
| WarpSync with per chunk light client validation might get the optimal | ||
| performance and safety. | ||
|
|
||
| ## Decision: Eager StateSync With Per Chunk Light Client Validation |
There was a problem hiding this comment.
Would this require bringing manifest hash into consensus?
There was a problem hiding this comment.
Will we only require validator nodes to compute and validate this hash?
There was a problem hiding this comment.
No it would not, the application state would be validated against the merkle root produced from light client sync.
Co-Authored-By: Aditya <adityasripal@gmail.com>
| * Speed: Expected throughput of producing and consuming snapshots | ||
| * Safety: Cost of pushing invalid snapshots to a node | ||
| * Liveness: Cost of preventing a node from receiving/constructing a snapshot | ||
| * Effort: How much effort does an implementation require |
There was a problem hiding this comment.
Also versatility - whether any additional requirements are imposed upon the ABCI application about e.g. storage layout.
There was a problem hiding this comment.
Would you say that could somehow be captured by engineering effort or should it be a distinct dimension?
| * Complete snapshot | ||
| * Ordered IAVL key ranges | ||
| * Compressed individually chunks which can be validated | ||
| * How is data validated |
There was a problem hiding this comment.
Are these intended to be mutually exclusive? There's a continuum w.r.t. validation of subcomponents of state, e.g. after receiving a few chunks, validate one at random & ban the peer if invalid, etc.
There was a problem hiding this comment.
Not at all. exactly as you state, the chunking scheme will have some impact on how soon data can be validated and peers banned.
| ["Warp Sync"](https://wiki.parity.io/Warp-Sync-Snapshot-Format.html) to rapidly | ||
| download both blocks and state snapshots from peers. Data is carved into ~4MB | ||
| chunks and snappy compressed. Hashes of snappy compressed chunks are stored in a | ||
| manifest file which co-ordinates the state-sync. Obtaining a correct manifest |
There was a problem hiding this comment.
That's lame. We should be able to verify random subsets of the state (random keys) pretty cheaply by keeping light client headers and requesting Merkle proofs occasionally, then ban any peer which sends invalid state, and recheck the whole state at the end.
There was a problem hiding this comment.
Does Parity use this manifest file instead of a SPV Ethereum client?
There was a problem hiding this comment.
Parity sync module takes a hybrid approach which will block header verification at the end but will sync intermediate state from snapshots first if WarpSync is enabled.
The general strategy is outlined here:
https://github.com/paritytech/parity-ethereum/blob/master/ethcore/sync/src/chain/mod.rs#L21-L34
Snapshots are vetted by rules and then taken from majority of peers here:
https://github.com/paritytech/parity-ethereum/blob/master/ethcore/sync/src/chain/mod.rs#L800-L828
brapse
left a comment
There was a problem hiding this comment.
No new question in a little while, LGTM 👍
Co-Authored-By: Anton Kaliaev <anton.kalyaev@gmail.com>
<!-- Please add a reference to the issue that this PR addresses and indicate which files are most critical to review. If it fully addresses a particular issue, please include "Closes #XXX" (where "XXX" is the issue number). If this PR is non-trivial/large/complex, please ensure that you have either created an issue that the team's had a chance to respond to, or had some discussion with the team prior to submitting substantial pull requests. The team can be reached via GitHub Discussions or the Cosmos Network Discord server in the #cometbft channel. GitHub Discussions is preferred over Discord as it allows us to keep track of conversations topically. https://github.com/cometbft/cometbft/discussions If the work in this PR is not aligned with the team's current priorities, please be advised that it may take some time before it is merged - especially if it has not yet been discussed with the team. See the project board for the team's current priorities: https://github.com/orgs/cometbft/projects/1 --> --- #### PR checklist - [ ] Tests written/updated - [ ] Changelog entry added in `.changelog` (we use [unclog](https://github.com/informalsystems/unclog) to manage our changelog) - [ ] Updated relevant documentation (`docs/` or `spec/`) and code comments
Initial State-sync discussions to be held in this PR. This is not the final stage of the PR.