Build a revert/apply journal between two Filecoin tipsets

Two tipsets at similar heights can lie on different branches. An indexer that needs to move between stored checkpoints can ask Lotus for the ordered changes.

Supply complete endpoint keys

The example uses one-block tipsets for readability. Replace the sample CIDs and include every CID when a tipset contains several blocks. The key's ordering must match Lotus's tipset representation.

{"jsonrpc":"2.0","id":1,"method":"Filecoin.ChainGetPath","params":[[{"/":"<block CID from old single-block tipset>"}],[{"/":"<block CID from new single-block tipset>"}]]}

Apply changes in returned order

A path can contain reverts back toward a common ancestor followed by applications on the destination branch. Undo derived effects for each revert before applying replacement records. Persist the resulting checkpoint with the last committed change. Sorting the list by height would destroy the order needed to reverse effects correctly.

docs.filecoin.io ChainGetPath