MerosCrypto / Meros

An instant and feeless cryptocurrency for the future, secured by the Merit Caching Consensus Mechanism.
https://meroscrypto.io
Other
82 stars 19 forks source link

Transaction Families #248

Closed kayabaNerve closed 3 years ago

kayabaNerve commented 4 years ago

Tracking issue explaining the new families branch.

A Transaction Family is defined as any transactions spending the same inputs. That said, they're easily extended. When a family is of input A, and another family of input B exists, a transaction spending A and B fits into both and neither. This causes the creation of family C, the union of families A and B.

These have ramifications when finalizing transactions, notably when it comes to the timing of when transactions are finalized.

https://github.com/MerosCrypto/Meros/blob/master/docs/Protocol/Merit.md describes it in the following paragraph:

On Block addition, a new Epoch is created. Epochs keep track of who verified a Transaction. Every Transaction that is first verified in that Block is added to the new Epoch. If a new Transaction competes with an existing Transaction, all competitors (and competitors of competitors) and children (and children of competitors) are brought up into the new Epoch. Every Transaction in Epochs is updated with the list of Merit Holders who verified it. The new Epoch is added to a list of the past 5 Epochs, and the oldest Epoch is removed. This oldest Epoch has all of its Transactions which weren't verified by the majority of the Unlocked Merit removed, and is then used to calculate rewards.

It should be noted competitors are only brought up if they otherwise would finalize before their parents.

So these are a necessary feature to handle finalization timing properly, and are partnered with the Epochs system. That said, this branch does NOT plan to include the Epochs redo. I want it to track families properly, and verify proper finalization of transactions with complex families. I also want this issue to consume #223 as that test will be solved once families are properly introduced.

Finally, we might as well update the protocol docs when we have this issue right here calling it out...

kayabaNerve commented 4 years ago

Defaulting will also be included in this.

kayabaNerve commented 3 years ago
kayabaNerve commented 3 years ago

Just needs python tests for some complex scenarios

kayabaNerve commented 3 years ago

Closed in #251.