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

Locked Merit/Finalization conflicts. #222

Open kayabaNerve opened 4 years ago

kayabaNerve commented 4 years ago

To provide context:

A Transaction takes 6 Blocks to verify so it always has a Checkpoint attached. After these 6 Blocks have been completed, I don't see any further value to bring up. This means a Transaction at max exists for 11 blocks. In order for Locked Merit to maintain its value at aiding instant Verifications, we need to require two complete Checkpoint periods before unlocking.

Unfortunately, the same applies in reverse to locking, somewhat. Instead of requiring one complete Checkpoint period to lock, we need to require two, OR implement advanced tracking of the state and make a lot of smaller decisions about edge cases. I rather just extend the Checkpoint periods for each. As a side note, depending on order of operations, one of these may need an extra Block added.

Once this is done, Consensus only needs to count Merit which is Unlocked at time of verifying the Transaction (or turned into Pending Merit at least one Block before).

As of right now, the discussion on #183, which spawned this issue, has Epochs using the raw Merit value. It should use the Unlocked Merit value, as this provides certainty around that.

kayabaNerve commented 4 years ago

Because we update the Epochs before performing State manipulation, this should be a firm 2 complete Checkpoint periods for both.

kayabaNerve commented 3 years ago

When we update the codebase with this functionality, I'd like to make these integer constants. They're currently hardcoded, and I have a feeling this will make it much harder to change.

kayabaNerve commented 3 years ago

This was meant to be included in the original issue; when a TX defaults, we can't verify it when it finalizes. We MUST verify it after the checkpoint after it finalizes.