Skip to content

ADR-053: state sync prototype#4352

Merged
erikgrinaker merged 20 commits intomasterfrom
adr-state-sync-prototype
Jan 30, 2020
Merged

ADR-053: state sync prototype#4352
erikgrinaker merged 20 commits intomasterfrom
adr-state-sync-prototype

Conversation

@erikgrinaker
Copy link
Contributor

Draft ADR describing a prototype for state sync (see #828).

  • Referenced an issue explaining the need for the change
  • Updated all relevant documentation in docs
  • Updated all code comments where relevant
  • Wrote tests
  • Updated CHANGELOG_PENDING.md

@codecov-io
Copy link

codecov-io commented Jan 28, 2020

Codecov Report

Merging #4352 into master will decrease coverage by 0.05%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4352      +/-   ##
==========================================
- Coverage    65.7%   65.65%   -0.06%     
==========================================
  Files         225      225              
  Lines       19771    19771              
==========================================
- Hits        12991    12981      -10     
- Misses       5752     5759       +7     
- Partials     1028     1031       +3
Impacted Files Coverage Δ
libs/events/events.go 93.2% <0%> (-4.86%) ⬇️
blockchain/v2/reactor.go 50.87% <0%> (-3.51%) ⬇️
consensus/reactor.go 77.62% <0%> (-1.04%) ⬇️
consensus/state.go 77.74% <0%> (-0.21%) ⬇️
consensus/replay.go 72.54% <0%> (+0.78%) ⬆️
p2p/pex/pex_reactor.go 83.61% <0%> (+1.69%) ⬆️


2. The node contacts the given seeds to discover peers.

3. The node contacts a set of full nodes, and verifies the trusted block header using the given hash via the light client.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we determine which nodes and how many?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is deliberately underspecified, we'll need further testing while prototyping to determine the optimal number.

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👨‍💻 great work!


* Is it possible to reconstruct an identical IAVL tree given separate subtrees in an appropriate order, or is more data needed about the branch structure?

* Should we punish nodes that provide invalid snapshots?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by punishing? Disconnecting from them should be enough for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the node happens to be a validators, it could be slashed for this, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you can prove it, sure

Copy link
Contributor

@tessr tessr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!

@erikgrinaker erikgrinaker force-pushed the adr-state-sync-prototype branch from 082b184 to 585478c Compare January 30, 2020 10:29
@erikgrinaker erikgrinaker merged commit b04b752 into master Jan 30, 2020
@erikgrinaker erikgrinaker deleted the adr-state-sync-prototype branch January 30, 2020 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants