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

Some beaten transactions mentioned on-chain are pruned. #238

Closed kayabaNerve closed 4 years ago

kayabaNerve commented 4 years ago

This causes a panic when the Epoch closes, as the Transaction which just got out of Epochs, and is therefore supposed to exist, doesn't actually exist.

kayabaNerve commented 4 years ago

Thinking this over, any reorganize call should reload the Epochs, fixing this. I have no idea why this occurs, though I can confirm the location at which it occurs.

kayabaNerve commented 4 years ago

TwoThirtyEight.log

Here's a log which finishes with this issue.

kayabaNerve commented 4 years ago

The issue is that Meros is pruning beaten Datas (and overall transactions) despite being mentioned on chain. Correlation with https://github.com/MerosCrypto/Meros/issues/223.

kayabaNerve commented 4 years ago

Problem is the finalize function removes pending holders from the holders, then if the transaction was beaten and holders.len == pending.len, it's pruned. Since we removed the pending holders from the holders, if we have two holders and one pending, this will return true.

kayabaNerve commented 4 years ago

While focusing on fixing this, turns out I left the vector generation inlined, and therefore at runtime... creating a new commit for that now.