-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24db710
commit d13fa2e
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
``` | ||
KIP: 8 | ||
Title: On the fly proof replacement mechanism | ||
Layer: P2P | ||
Type: Standards Track | ||
Author: Ori Newman <[email protected]> | ||
Status: Draft | ||
``` | ||
|
||
# Motivation | ||
When a new node joins the network it can start syncing from an out-of-date node, and only after the long sync it'll realize the network has a better tip. | ||
So there's a need to propose better tips in the middle of staging IBD. | ||
|
||
# Proposal | ||
While there's an active staging consensus and we get a relay block B from peer P we'll do one of the following steps: | ||
|
||
* If B.pruning_point is in the antipast of staging.pruning_point (can be checked with staging.past_pruning_points), request pruning point proof from P and if `staging.validate_pruning_point_proof(P.pruning_point_proof)` is true, delete the current `staging` and start an IBD from P. | ||
|
||
**Rationale**: `P.validate_pruning_point_proof` is undeniably better than current proof, so we switch to it. | ||
|
||
* If staging consensus is still active, but there's no IBD related to it (for example, syncer has disconnected in the middle), any relay block that will claim to have a better proof will win. If `B.pruning_point` is the same as `staging.pruning_point` we just resume the IBD from where we stopped. | ||
|
||
**Rationale**: The syncer that triggered the creation of current staging consensus was unable to prove that the suggested pruning point has `pruning_depth` confirmations. In most cases the disconnect was not done maliciously, so we expect other peers to have the same state and continue to send us headers accordingly. But if some peer claims to have a better state we have to believe it until proven otherwise by a third peer. | ||
|
||
# Backward compatibility | ||
This KIP introduces a better decision mechanism to find the best pruning point proof faster. This decision mechanism is relevant only to the upgraded node itself, and should not interrupt any communication with the rest of the network, including non upgraded nodes. |