IntersectMBO / cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Apache License 2.0
256 stars 158 forks source link

Create Ledger State test tool #4618

Open lehins opened 3 weeks ago

lehins commented 3 weeks ago

In order to avoid bugs like the one that was fixed in #4589 we need a set of tools that we can easily apply to the Mainnet's ledger state.

This tool will have a command line interface for reading a ledger state snapshot in the format that is produced by the consensus code. After successfully reading the snapshot it will be able to perform various tests on it. Here is a short list that comes to mind:

  1. Roundtrip test. Serialize it and then deserialize it back, comparing that the actual contents have not changed.
  2. Translate test. Whenever new era has been implemented, but is not active yet we can take a NewEpochState and translate into the next era. After the translation it would be followed by the same Roundtrip test as above.

This tool would then be used by integration test team to run on the latest mainnet snapshot. This should be fairly simple to implement, since latest mainnet snapshot is always available after the sync test.

lehins commented 3 weeks ago

We could repurpose ledger-state tool that we already have in this repo for this purpose, but this is yet to be decided.

This is a low priority task, since the next hard-fork is still far away.

lehins commented 3 weeks ago

CC @mkoura We've discussed this during the call earlier today. Feel free to add any comments, ideas or restrictions on this tool that you would like to see.