Neptune-Crypto / neptune-core

anonymous peer-to-peer cash
Apache License 2.0
25 stars 7 forks source link

Thv/#145 reorganization of mempool #153

Closed Sword-Smith closed 4 months ago

Sword-Smith commented 4 months ago

Simple solution to the inability of the mempool to handle reorganizations: Clear the mempool if that happens.

Context: all transactions need to contain proofs relating to the mutator set of the latest block. 3rd parties can update this information in the common case (new ti is child of previous tip), but this proof updating is complicated for reorganizations. So for now, we just clear the mempool in the case of a reorganization.

Sword-Smith commented 4 months ago

The failing test in CI is the one addressed in #150 and has nothing to do with this PR.

Sword-Smith commented 4 months ago

I added a document about the program's tolerance to reorganizations. Please review.

Sword-Smith commented 4 months ago

Apparently my make all does not do the same checks as the CI. I'll fix that and update the PR.

Edit: The reason was that nextest does not run doc tests. So I'm adding cargo test --doc to the Makefile's test recipe.

Note: Doctests are currently not supported because of limitations in stable Rust. For now, run doctests in a separate step with cargo test --doc.

Sword-Smith commented 4 months ago

Fixed the discrepancy between make all and CI by adding cargo t --doc to make's test recipe.

Sword-Smith commented 4 months ago

This closes #145.