celestia-core is a fork of cometbft/cometbft, an implementation of the Tendermint protocol, with the following changes:
- Modifications to how
DataHash
in the block header is determined. In CometBFT,DataHash
is based on the transactions included in a block. In Celestia, block data (including transactions) are erasure coded into a data square to enable data availability sampling. In order for the header to contain a commitment to this data square,DataHash
was modified to be the Merkle root of the row and column roots of the erasure coded data square. See ADR 008 for the motivation or celestia-app/pkg/da/data_availability_header.go for the implementation. TheDataHash
is computed by the application inPrepareProposal
and returned toCometBFT
as the second to last transaction. The last transaction is the big endian encoded uint64 of the square size. TheSquareSize
is included in the modifiedData
struct that is gossiped to peers. SimilarlyCometBFT
passes theDataHash
as the second to last tx and theSquareSize
as the final transaction inProcessProposal
. - A content-addressable transaction (CAT) pool was implemented using the
Mempool
interface to reduce the duplication and thus bandwidth of peers sending transactions to one another. The specification can be found here.
See ./docs/celestia-architecture for architecture decision records (ADRs) on Celestia modifications.
^ +-------------------------------+ ^
| | | |
| | State-machine = Application | |
| | | | celestia-app (built with Cosmos SDK)
| | ^ + | |
| +----------- | ABCI | ----------+ v
Celestia | | + v | ^
validator or | | | |
full consensus | | Consensus | |
node | | | |
| +-------------------------------+ | celestia-core (fork of CometBFT)
| | | |
| | Networking | |
| | | |
v +-------------------------------+ v
See https://github.com/celestiaorg/celestia-app#install
See https://github.com/celestiaorg/celestia-app#usage
This repo intends on preserving the minimal possible diff with cometbft/cometbft to make fetching upstream changes easy. If the proposed contribution is
- specific to Celestia: consider if celestia-app is a better target
- not specific to Celestia: consider making the contribution upstream in CometBFT
- Install Go 1.22.4+
- Fork this repo
- Clone your fork
- Find an issue to work on (see good first issues)
- Work on a change in a branch on your fork
- When your change is ready, push your branch and create a PR that targets this repo
# Build a new CometBFT binary and output to build/comet
make build
# Install CometBFT binary
make install
# Run tests
make test
# If you modified any protobuf definitions in a `*.proto` file then
# you may need to lint, format, and generate updated `*.pb.go` files
make proto-lint
make proto-format
make proto-gen
There are two actively maintained branches in this repo:
v0.34.x-celestia
was originally based on tendermint'sv0.34.x
release branch but now it receives patches from the CometBFTv0.34.x
release branch. This branch also contains Celestia-specific changes. Futurev1.x.0-tm-v0.34.x
releases of this repo will be based on this branch.main
is based on CometBFT and contains Celestia-specific changes. Futurev2.x.x-tm-v0.x.x
releases of this repo will be based on this branch.
Usually PRs should target the main
branch. After the PR merges to main, if the PR contained non-breaking changes, a maintainer may cherry-pick it to an existing release branch (e.g. v0.34.x-celestia
) and cut a new release.
Releases are formatted: v<CELESTIA_CORE_VERSION>-tm-v<TENDERMINT_CORE_VERSION>
For example: v1.4.0-tm-v0.34.20
is celestia-core version 1.4.0
based on CometBFT 0.34.20
.
CELESTIA_CORE_VERSION
strives to adhere to Semantic Versioning.