Closed karimodm closed 8 months ago
I think we're currently not including invalid blocks or invalid transactions to the TipManager
as these are discarded when the invalidity is established, i.e. before reaching the TipManager
. The TipManager
as such does not need to worry about invalid blocks.
PreSolidFilter
and PostSolidFilter
based on several rules. However, we don't set blocks as invalid if they are filtered.Blocks are marked as invalid if their transaction is orphaned and the orphaned slot is below the block's slotcommitment slot.
Is that correct though? If transaction is invalid we still book the block carrying that transaction. Why should it be otherwise if the transaction is orphaned when we try to book the block? Shouldn't we treat it the same as an invalid transaction in this case?
A transaction is orphaned when:
This also seems prone to race conditions, because if one node orphans the transaction, evicts it and then processes a new attachment of that transaction, it would not mark the block as invalid and would successfully attach the transaction to the mempool (as it already forgot about the orphaned version). However if a node evicts slightly later and sees the same block, it would not add a fresh attachments to the mempool (because it still has the orphaned version), and would mark the block (and it's whole future cone) as invalid.
Created more specific issues for the above open questions. Closing this one as the core question seems to be clear and not a problem.
Let's think about this again after the recent changes to the tipmanager.