trust-net / dag-lib-go

Go library for DAG protocol
MIT License
3 stars 0 forks source link

Submitter history sync protocol #37

Closed gnulib closed 5 years ago

gnulib commented 5 years ago

Objective

Honest nodes with DLT stack should be in sync w.r.t. to transaction history for a submitter. If peer nodes exchange any transaction that has a last submitter transaction not known, they should reject the network transaction and instead initiate a submitter history sync.

Acceptance Criteria

As per "A simple double spending resolution protocol" rules described in #30, when a node receives a network transaction from a peer when the "last transaction" from submitter is not known, a submitter sync will be initiated with the peer as following:

gnulib commented 5 years ago

Revised Submitter Sync Protocol

We need to change above submitter sync protocol so that it does not save the unknown transactions into ToBeFetchedStack while walking up the submitter's history. Instead, we want to walk up the history as much as needed without saving anything (so that no "overflow" attack can be done), then once we find a sequence that has all known transactions, we start processing down the history sequence and process all transaction for that sequence before moving to next (breadth first processing). In this process, if there is any double spending situation found, it will create a double spending alert (causing shard to flush and re-sync) and the submitter should be "black-listed" on the node.

InitiateSubmitterSync

WalkUpStage

ProcessDownStage


(All of below is not applicable since we are processing transaction right away and not keeping in any queue for later processing)

~ProcessSubmitterQueue~