ouroboros-network icon indicating copy to clipboard operation
ouroboros-network copied to clipboard

Test the ledger interface used by the mempool

Open jasagredo opened this issue 3 years ago • 1 comments

We mock the LedgerInterface and in particular getLedgerStateForTxs. It seems we need to add tables to the mempool to exercise the part of the mempool logic that deals with them. Which options do we have?

Option 0: Mock the LedgerInterface with ledger tables. The problem with this is that we'd still need to test mempool implementation.

Option 1: use the actual ledger interface:

chainDBLedgerInterface ::
     ( IOLike m
     , LedgerSupportsMempool blk
     )
  => ChainDB m blk -> LedgerInterface m blk

The problem with this is that it requires an actual Chain DB! So this might require significant modifications to the mempool-test code.

First, we need to test the correctness of getLedgerStateForKeys, which is part of the ChainDB API. Why? Because getLedgerStateForTxs relies on this function.

Second, we could use chainDBLedgerInterface if we could find a way to generate arbitrary ChainDB's and add this to TestMempool.

jasagredo avatar Aug 18 '22 12:08 jasagredo

This is on hold because we might do a mempool rewrite instead

jasagredo avatar Sep 21 '22 13:09 jasagredo

This should be fixed by https://github.com/input-output-hk/ouroboros-network/issues/4044

dnadales avatar Oct 20 '22 08:10 dnadales

I'm closing this one in favor of #4044

jasagredo avatar Nov 28 '22 15:11 jasagredo