kindelia / Kindelia

An efficient, secure cryptocomputer
https://kindelia.org/
602 stars 41 forks source link

Strange behaviour when publishing transactions #244

Closed steinerkelvin closed 1 year ago

steinerkelvin commented 1 year ago

Creating this issue to track the problem described in #229 (specially this comment).

I did not investigate this yet, but I think this is related to this code, which removes included transactions from the mempool, only runs for the tip block of the included blocks:

+++ kindelia_core/src/node.rs
@@ -940,7 +940,7 @@ impl<C: ProtoComm, S: BlockStorage> Node<C, S> {
               tags = mining,
               stopped
             );

>            for tx in extract_transactions(&block.body) {
>             self.pool.remove(&tx);
>            }

It should instead run for all blocks in the reorg.

Also, we should add rolled-back block transactions back to the mempool. That's probably the expected behaviour.

@racs4