github.com/badrootd/celestia-core@v0.0.0-20240305091328-aa4207a4b25d/README.md (about)

     1  # celestia-core
     2  
     3  [![Go Reference](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/celestiaorg/celestia-core)
     4  [![GitHub Release](https://img.shields.io/github/v/release/celestiaorg/celestia-core)](https://github.com/celestiaorg/celestia-core/releases/latest)
     5  [![Go Report Card](https://goreportcard.com/badge/github.com/celestiaorg/celestia-core)](https://goreportcard.com/report/github.com/celestiaorg/celestia-core)
     6  [![Build](https://github.com/celestiaorg/celestia-core/actions/workflows/build.yml/badge.svg)](https://github.com/celestiaorg/celestia-core/actions/workflows/build.yml)
     7  [![Lint](https://github.com/celestiaorg/celestia-core/actions/workflows/lint.yml/badge.svg)](https://github.com/celestiaorg/celestia-core/actions/workflows/lint.yml)
     8  [![Tests](https://github.com/celestiaorg/celestia-core/actions/workflows/tests.yml/badge.svg)](https://github.com/celestiaorg/celestia-core/actions/workflows/tests.yml)
     9  
    10  celestia-core is a fork of [cometbft/cometbft](https://github.com/cometbft/cometbft), an implementation of the Tendermint protocol, with the following changes:
    11  
    12  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](https://github.com/celestiaorg/celestia-core/blob/v0.34.x-celestia/docs/celestia-architecture/adr-008-updating-to-tendermint-v0.35.x.md?plain=1#L20) for the motivation or [celestia-app/pkg/da/data_availability_header.go](https://github.com/celestiaorg/celestia-app/blob/2f89956b22c4c3cfdec19b3b8601095af6f69804/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`.
    13  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](./mempool/cat/spec.md).
    14  
    15  
    16  See [./docs/celestia-architecture](./docs/celestia-architecture/) for architecture decision records (ADRs) on Celestia modifications.
    17  
    18  ## Diagram
    19  
    20  ```ascii
    21                  ^  +-------------------------------+  ^
    22                  |  |                               |  |
    23                  |  |  State-machine = Application  |  |
    24                  |  |                               |  |   celestia-app (built with Cosmos SDK)
    25                  |  |            ^      +           |  |
    26                  |  +----------- | ABCI | ----------+  v
    27  Celestia        |  |            +      v           |  ^
    28  validator or    |  |                               |  |
    29  full consensus  |  |           Consensus           |  |
    30  node            |  |                               |  |
    31                  |  +-------------------------------+  |   celestia-core (fork of CometBFT)
    32                  |  |                               |  |
    33                  |  |           Networking          |  |
    34                  |  |                               |  |
    35                  v  +-------------------------------+  v
    36  ```
    37  
    38  ## Install
    39  
    40  See <https://github.com/celestiaorg/celestia-app#install>
    41  
    42  ## Usage
    43  
    44  See <https://github.com/celestiaorg/celestia-app#usage>
    45  
    46  ## Contributing
    47  
    48  This repo intends on preserving the minimal possible diff with [cometbft/cometbft](https://github.com/cometbft/cometbft) to make fetching upstream changes easy. If the proposed contribution is
    49  
    50  - **specific to Celestia**: consider if [celestia-app](https://github.com/celestiaorg/celestia-app) is a better target
    51  - **not specific to Celestia**: consider making the contribution upstream in CometBFT
    52  
    53  1. [Install Go](https://go.dev/doc/install) 1.22+
    54  2. Fork this repo
    55  3. Clone your fork
    56  4. Find an issue to work on (see [good first issues](https://github.com/celestiaorg/celestia-core/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22))
    57  5. Work on a change in a branch on your fork
    58  6. When your change is ready, push your branch and create a PR that targets this repo
    59  
    60  ### Helpful Commands
    61  
    62  ```sh
    63  # Build a new CometBFT binary and output to build/comet
    64  make build
    65  
    66  # Install CometBFT binary
    67  make install
    68  
    69  # Run tests
    70  make test
    71  
    72  # If you modified any protobuf definitions in a `*.proto` file then
    73  # you may need to lint, format, and generate updated `*.pb.go` files
    74  make proto-lint
    75  make proto-format
    76  make proto-gen
    77  ```
    78  
    79  ## Branches
    80  
    81  There are two actively maintained branches in this repo:
    82  
    83  - `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.
    84  - `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.
    85  
    86  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.
    87  
    88  ## Versioning
    89  
    90  Releases are formatted: `v<CELESTIA_CORE_VERSION>-tm-v<TENDERMINT_CORE_VERSION>`
    91  For example: [`v1.4.0-tm-v0.34.20`](https://github.com/celestiaorg/celestia-core/releases/tag/v1.4.0-tm-v0.34.20) is celestia-core version `1.4.0` based on CometBFT `0.34.20`.
    92  `CELESTIA_CORE_VERSION` strives to adhere to [Semantic Versioning](http://semver.org/).
    93  
    94  ## GitPOAP
    95  
    96  This repo is eligible for [GitPOAP](https://www.gitpoap.io). You can see the remaining eligible repositories at [gitpoap/celestiaorg](https://www.gitpoap.io/gh/celestiaorg).
    97  
    98  ## Careers
    99  
   100  We are hiring Go engineers! Join us in building the future of blockchain scaling and interoperability. [Apply here](https://jobs.lever.co/celestia).