celestia-core

module
v0.0.0-...-22ab5e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: Apache-2.0

README

celestia-core

Go Reference GitHub Release Go Report Card Build Lint Tests

celestia-core is a fork of cometbft/cometbft, an implementation of the Tendermint protocol, with the following changes:

  1. 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. The DataHash is computed by the application in PrepareProposal and returned to CometBFT as the second to last transaction. The last transaction is the big endian encoded uint64 of the square size. The SquareSize is included in the modified Data struct that is gossiped to peers. Similarly CometBFT passes the DataHash as the second to last tx and the SquareSize as the final transaction in ProcessProposal.
  2. 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.

Diagram

                ^  +-------------------------------+  ^
                |  |                               |  |
                |  |  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

Install

See https://github.com/celestiaorg/celestia-app#install

Usage

See https://github.com/celestiaorg/celestia-app#usage

Contributing

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
  1. Install Go 1.22+
  2. Fork this repo
  3. Clone your fork
  4. Find an issue to work on (see good first issues)
  5. Work on a change in a branch on your fork
  6. When your change is ready, push your branch and create a PR that targets this repo
Helpful Commands
# 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

Branches

There are two actively maintained branches in this repo:

  • v0.34.x-celestia was originally based on tendermint's v0.34.x release branch but now it receives patches from the CometBFT v0.34.x release branch. This branch also contains Celestia-specific changes. Future v1.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. Future v2.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.

Versioning

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.

GitPOAP

This repo is eligible for GitPOAP. You can see the remaining eligible repositories at gitpoap/celestiaorg.

Careers

We are hiring Go engineers! Join us in building the future of blockchain scaling and interoperability. Apply here.

Directories

Path Synopsis
abci
server
Package server is used to start a new ABCI server.
Package server is used to start a new ABCI server.
Package Behaviour provides a mechanism for reactors to report behaviour of peers.
Package Behaviour provides a mechanism for reactors to report behaviour of peers.
v0
v1
v2
cmd
merkle
Package merkle computes a deterministic minimal height Merkle tree hash.
Package merkle computes a deterministic minimal height Merkle tree hash.
xchacha20poly1305
Package xchacha20poly1305 creates an AEAD using hchacha, chacha, and poly1305 This allows for randomized nonces to be used in conjunction with chacha.
Package xchacha20poly1305 creates an AEAD using hchacha, chacha, and poly1305 This allows for randomized nonces to be used in conjunction with chacha.
Package evidence handles all evidence storage and gossiping from detection to block proposal.
Package evidence handles all evidence storage and gossiping from detection to block proposal.
libs
cli
events
Package events - Pub-Sub in go with event caching
Package events - Pub-Sub in go with event caching
flowrate
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
Package flowrate provides the tools for monitoring and limiting the flow rate of an arbitrary data stream.
json
Package json provides functions for marshaling and unmarshaling JSON in a format that is backwards-compatible with Amino JSON encoding.
Package json provides functions for marshaling and unmarshaling JSON in a format that is backwards-compatible with Amino JSON encoding.
log
net
os
pubsub
Package pubsub implements a pub-sub model with a single publisher (Server) and multiple subscribers (clients).
Package pubsub implements a pub-sub model with a single publisher (Server) and multiple subscribers (clients).
pubsub/query
Package query implements the custom query format used to filter event subscriptions in CometBFT.
Package query implements the custom query format used to filter event subscriptions in CometBFT.
package light provides a light client implementation.
package light provides a light client implementation.
rpc
cat
v0
TODO: Better handle abci client errors.
TODO: Better handle abci client errors.
v1
Package node is the main entry point, where the Node struct, which represents a full node, is defined.
Package node is the main entry point, where the Node struct, which represents a full node, is defined.
p2p
pex
upnp
Taken from taipei-torrent.
Taken from taipei-torrent.
pkg
Package privval provides different implementations of the types.PrivValidator.
Package privval provides different implementations of the types.PrivValidator.
proto
rpc
core
Package core defines the CometBFT RPC endpoints.
Package core defines the CometBFT RPC endpoints.
jsonrpc
HTTP RPC server supporting calls via uri params, jsonrpc over HTTP, and jsonrpc over websockets
HTTP RPC server supporting calls via uri params, jsonrpc over HTTP, and jsonrpc over websockets
jsonrpc/server
Commons for HTTP handling
Commons for HTTP handling
scripts
indexer/sink/psql
Package psql implements an event sink backed by a PostgreSQL database.
Package psql implements an event sink backed by a PostgreSQL database.
test
app

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL