celestiaorg / celestia-core

Celestia node software based on Tendermint.
https://celestia.org/
Apache License 2.0
471 stars 247 forks source link

Compact historical queries #1328

Open rootulp opened 2 months ago

rootulp commented 2 months ago

Context

During a onsite meeting, we discussed that the Headicure sub-workstream for header-pruning has a prerequisite on a consensus breaking change in celestia-core. The consensus breaking change is to make block's commit to a Merkle mountain range of previous blocks.

Most of the motivation for this is that Celestia light nodes after Headicure header-pruning won't retain block headers after a certain window. So the Merkle mountain range in the header enables light nodes to make claims about things in historical blocks (i.e. blobs, transactions, state) that they no longer have the header for.

Proposal

Investigate if it's possible to convert BlockID.Hash into a Merkle mountain range.

https://github.com/celestiaorg/celestia-core/blob/d5042ba999f8ca6abb0348dda8efc8ea7147e7cd/proto/tendermint/types/types.pb.go#L211-L215

Note: this is a consensus breaking change. Adopting this change may involve a multi-step migration plan. We may release one version where consensus nodes can start computing the Merkle mountain range. After a period of time, we can create another release where consensus nodes start including their computed hash after a particular block height. This release process draws inspiration from the Ethereum Verkle tree migration.

rach-id commented 2 months ago

To add more information:

Please correct me if I missed something.

musalbas commented 2 months ago

I still think this is a very over-engineered solution compared to just making it so that Celestia light nodes store just the data root and state root of the past headers, rather than the entire header.