IntersectMBO / IntersectMBO/ouroboros-consensus
Utilize the current BlockchainTime with applyChainTick in the mempool
- Dominant language
- Haskell
- Stars
- 67
- Forks
- 43
- Avg merge
- 5d 13h
- Merged PRs (30d)
- 43
Description
Related to issue input-output-hk/ouroboros-network#1291 and PR input-output-hk/ouroboros-network#1295.
Since the merge of PR input-output-hk/ouroboros-network#1295, when syncing the contents of the mempool with the ledger state, we first utilize `applyChainTick` before mempool transaction validation.
If we're actually forging a block, we provide the mempool sync function with the `SlotNo` for which that block is to be forged. However, there are times where we sync the mempool contents without knowing the slot number of the block that they'll end up in. In this particular case, we just sync the mempool contents given the `ledgerTipSlot + 1`.
The problem with using the `ledgerTipSlot` is that it only represents the slot number in which the last block that was applied to the ledger was forged. i.e. this isn't necessarily the chain's current slot number as the `ledgerTipSlot` is only updated when new blocks are applied. For example, if 5 consecutive slots are missed, the `ledgerTipSlot` will be 5 slots behind the chain's current slot number.
To remedy this and ensure that we use the chain's actual current slot number, we should instead utilize the `SlotNo` from the current `BlockchainTime`.
Contributor guide
Assessment
This issue has not been assessed yet.