Meta

Created October 18, 2024

Status:

Jen dump:

Fast Finality aware APIs for Lotus

The critical pathway for F3 to achieve impact is to make Fast Finality easy to use within the Filecoin ecosystem. In that regard, we want to introduce new APIs to make the notion of finality and finalized tipsets first-class citizens of the API layer.

The key API-related pain points identified in user interviews are the complexities of using tipsets and unclear guidance on the finality.

Many users have mixed-use cases that want to know the state in the latest and finalized/safe blocks. Another possible simplification for users is allowing them to use epochs when the context enables consistent information to be displayed.

The Ethereum ecosystem established the practice of accepting either Height or a Tag (where the tag can refer to, for example, the latest or finalized blocks) in many of its APIs that need a reference to a block. Within Filecoin, we mostly used TipSets, equivalent to Eth’s blockHash. From reading Eth’s APIs, whenever the API pertains to some changes happening or needs to return the reference to a block, it returns it as blockHash.

Due to the slightly more unstable nature of Filecoin’s Expected Consensus, our policy has been to use almost exclusively TipSets to refer to blocks, except for GetTipsetByHeight. Still, in the CLI layer, we introduced a shortcut for using epochs. There is no reason this could not be extended to API users, although it will require extra caution.

Multi-type chain references

Our standard chain reference is a TipSetKey, equivalent to a block hash. With the introduction of fast finality, we have the chance to evolve our APIs to facilitate easier use by permitting the use of labels and epochs.