Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compact historical queries #1328

Open
rootulp opened this issue Apr 29, 2024 · 2 comments
Open

Compact historical queries #1328

rootulp opened this issue Apr 29, 2024 · 2 comments
Labels
ice-box issues are automatically assigned this label until they are planned. proposal ideas that are not planned

Comments

@rootulp
Copy link
Collaborator

rootulp commented Apr 29, 2024

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.

// BlockID
type BlockID struct {
Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
PartSetHeader PartSetHeader `protobuf:"bytes,2,opt,name=part_set_header,json=partSetHeader,proto3" json:"part_set_header"`
}

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.

@rootulp rootulp changed the title Consider Merkle mountain ranging BlockID.Hash 🏔️ Compact historical blob queries Apr 29, 2024
@rootulp rootulp changed the title Compact historical blob queries Compact historical queries Apr 29, 2024
@rach-id
Copy link
Member

rach-id commented Apr 29, 2024

To add more information:

  • The merkle tree implementation used will be the RFC6962, and it's a merkle mountain tree specification for an add-only log of certificates.
  • The Hash would be replaced by the right most path of the tree. This would allow proving inclusion of recent blocks. Also, would provide all the nodes that need to be updated when adding a new header efficiently.

Please correct me if I missed something.

@musalbas
Copy link
Member

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.

@evan-forbes evan-forbes added proposal ideas that are not planned ice-box issues are automatically assigned this label until they are planned. labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ice-box issues are automatically assigned this label until they are planned. proposal ideas that are not planned
Projects
None yet
Development

No branches or pull requests

4 participants