nanocurrency / nano-node

Nano is digital currency. Its ticker is: XNO and its currency symbol is: Ӿ
https://nano.org
BSD 3-Clause "New" or "Revised" License
3.47k stars 785 forks source link

Research better block liveness approach to propagation #1453

Open rkeene opened 5 years ago

rkeene commented 5 years ago

In order to better propagate only live blocks to peers, we need to be able to classify blocks as either "new"/"active" or "existing" from the perspective of the network, but from our node.

One way we could accomplish this is to have representatives periodically emit a signed message that gives a fuzzy view into their complete ledger.

One way to construct this fuzzy view is to XOR the hash of the mod-N'th block-from-open (e.g., for an account chain with 15 blocks, use the 10th block-from-open; for an account chain with 25 blocks, use the 20th block-from-open) for each account chain (if an account chain has less than N blocks, skip the account).

By comparing the signed checksum, picking the one with the highest aggregate weight, we can determine whether our local ledger is in-sync from the perspective, or possibly out of sync.

A node that believes it is out of sync from the perspective of network can be more conservative about publishing blocks to peers, which likely already have them, and instead wait until it becomes in sync with the rest of the network to decide how it differs and which blocks should be broadcast from its ledger.

This issue is to track the benefits to this mechanism and keep track of experimental data.

rkeene commented 5 years ago

As part of this announcement, include also the total number of blocks in the ledger -- this can be useful for nodes to report on a sync status.