Skip to content

Commit

Permalink
Add KIP 8
Browse files Browse the repository at this point in the history
  • Loading branch information
someone235 committed Sep 21, 2023
1 parent 24db710 commit d13fa2e
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions kip-0008.md
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.

0 comments on commit d13fa2e

Please sign in to comment.