Skip to content

Commit

Permalink
Merge branch 'main' into rp/e2e-test-chain-id
Browse files Browse the repository at this point in the history
  • Loading branch information
rootulp committed Dec 13, 2024
2 parents 9208328 + 9caf2b9 commit 63fc9ab
Show file tree
Hide file tree
Showing 47 changed files with 475 additions and 356 deletions.
7 changes: 0 additions & 7 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,3 @@

# global owners
* @celestiaorg/celestia-core

# directory owners
# NOTE: the directory owners should include the global owners unless the global
# owner is fully deferring ownership to the directory owner
docs @liamsi @celestiaorg/celestia-core
specs @liamsi @celestiaorg/celestia-core
x/blobstream @rach-id @evan-forbes
10 changes: 5 additions & 5 deletions .github/auto_request_review.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# More info at https://github.com/necojackarc/auto-request-review
reviewers:
# The default reviewers
defaults:
# Example of Github Team. Github team must have write access to repo.
# NOTE: This assigned the team itself, not members of the team. The Github
# team auto PR assignment will then turn this into individuals
- team:celestia-core # This is the Github Team
- cmwaters
- evan-forbes
- ninabarbakadze
- rach-id
- rootulp

options:
ignore_draft: true
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- "v*"
tags:
- "v*"
release:
types: [published]
pull_request:

jobs:
Expand All @@ -22,6 +24,7 @@ jobs:
uses: ./.github/workflows/test.yml

goreleaser:
if: github.event_name == 'release'
uses: ./.github/workflows/goreleaser.yml
permissions: write-all
secrets:
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,15 @@ on:

jobs:
goreleaser-check:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set GORELEASER_CURRENT_TAG in GitHub env
run: echo "GORELEASER_CURRENT_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
Expand All @@ -21,18 +24,21 @@ jobs:
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' >> .release-env
- name: Check the .goreleaser.yaml config file
run: make goreleaser-check
env:
GORELEASER_CURRENT_TAG: ${{ env.GORELEASER_CURRENT_TAG }}

goreleaser:
if: github.event_name == 'release'
needs: goreleaser-check
runs-on: ubuntu-latest
if: |
(github.event_name == 'push' && contains(github.ref, 'refs/tags/'))
permissions: write-all
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set GORELEASER_CURRENT_TAG in GitHub env
run: echo "GORELEASER_CURRENT_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
Expand All @@ -41,3 +47,5 @@ jobs:
echo 'GITHUB_TOKEN=${{secrets.GORELEASER_ACCESS_TOKEN}}' >> .release-env
- name: Create prebuilt binaries and attach them to the GitHub release
run: make prebuilt-binary
env:
GORELEASER_CURRENT_TAG: ${{ env.GORELEASER_CURRENT_TAG }}
88 changes: 48 additions & 40 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,4 @@
# GIT_TAG is an environment variable that is set to the latest git tag on the
# current commit with the following example priority: v2.2.0, v2.2.0-mocha,
# v2.2.0-arabica, v2.2.0-rc0, v2.2.0-beta, v2.2.0-alpha. If no tag points to the
# current commit, git describe is used. The priority in this command is
# necessary because `git tag --sort=-creatordate` only works for annotated tags
# with metadata. Git tags created via GitHub releases are not annotated and do
# not have metadata like creatordate. Therefore, this command is a hacky attempt
# to get the most recent tag on the current commit according to Celestia's
# testnet versioning scheme + SemVer.
GIT_TAG := $(shell git tag --points-at HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$$' \
|| git tag --points-at HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-mocha$$' \
|| git tag --points-at HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-arabica$$' \
|| git tag --points-at HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-rc[0-9]*$$' \
|| git tag --points-at HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-(beta)$$' \
|| git tag --points-at HEAD --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+-(alpha)$$' \
|| git describe --tags)
VERSION := $(shell echo $(GIT_TAG) | sed 's/^v//')
VERSION := $(shell echo $(shell git describe --tags 2>/dev/null || git log -1 --format='%h') | sed 's/^v//')
COMMIT := $(shell git rev-parse --short HEAD)
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf
Expand All @@ -41,13 +25,14 @@ BUILD_FLAGS := -tags "ledger" -ldflags '$(ldflags)'
## help: Get more info on make commands.
help: Makefile
@echo " Choose a command run in "$(PROJECTNAME)":"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@sed -n 's/^##//p' $< | sort | column -t -s ':' | sed -e 's/^/ /'
.PHONY: help

## build: Build the celestia-appd binary into the ./build directory.
build: mod
@cd ./cmd/celestia-appd
@mkdir -p build/
@echo "--> Building build/celestia-appd"
@go build $(BUILD_FLAGS) -o build/ ./cmd/celestia-appd
.PHONY: build

Expand Down Expand Up @@ -95,25 +80,34 @@ proto-format:
@$(DOCKER_PROTO_BUILDER) find . -name '*.proto' -path "./proto/*" -exec clang-format -i {} \;
.PHONY: proto-format

## build-docker: Build the celestia-appd docker image from the current branch. Requires docker.
build-docker:
@echo "--> Building Docker image"
$(DOCKER) build -t celestiaorg/celestia-app -f docker/Dockerfile .
.PHONY: build-docker

## build-ghcr-docker: Build the celestia-appd docker image from the last commit. Requires docker.
## docker-build: Build the celestia-appd docker image from the current branch. Requires docker.
docker-build: build-docker
.PHONY: docker-build

build-ghcr-docker:
@echo "--> Building Docker image"
$(DOCKER) build -t ghcr.io/celestiaorg/celestia-app:$(COMMIT) -f docker/Dockerfile .
.PHONY: build-ghcr-docker

## publish-ghcr-docker: Publish the celestia-appd docker image. Requires docker.
## docker-build-ghcr: Build the celestia-appd docker image from the last commit. Requires docker.
docker-build-ghcr: build-ghcr-docker
.PHONY: docker-build-ghcr

publish-ghcr-docker:
# Make sure you are logged in and authenticated to the ghcr.io registry.
@echo "--> Publishing Docker image"
$(DOCKER) push ghcr.io/celestiaorg/celestia-app:$(COMMIT)
.PHONY: publish-ghcr-docker

## docker-publish: Publish the celestia-appd docker image. Requires docker.
docker-publish: publish-ghcr-docker
.PHONY: docker-publish

## lint: Run all linters; golangci-lint, markdownlint, hadolint, yamllint.
lint:
@echo "--> Running golangci-lint"
Expand All @@ -127,21 +121,27 @@ lint:
@yamllint --no-warnings . -c .yamllint.yml
.PHONY: lint

## markdown-link-check: Check all markdown links.
markdown-link-check:
@echo "--> Running markdown-link-check"
@find . -name \*.md -print0 | xargs -0 -n1 markdown-link-check
.PHONY: markdown-link-check

## lint-links: Check all markdown links.
lint-links: markdown-link-check
.PHONY: lint-links


## fmt: Format files per linters golangci-lint and markdownlint.
fmt:
@echo "--> Running golangci-lint --fix"
@golangci-lint run --fix
@echo "--> Running markdownlint --fix"
@markdownlint --fix --quiet --config .markdownlint.yaml .
.PHONY: fmt

## lint-fix: Format files per linters golangci-lint and markdownlint.
lint-fix: fmt
.PHONY: lint-fix

## test: Run tests.
test:
@echo "--> Running tests"
Expand Down Expand Up @@ -220,7 +220,7 @@ goreleaser-check:
docker run \
--rm \
--env CGO_ENABLED=1 \
--env GORELEASER_CURRENT_TAG=${GIT_TAG} \
--env GORELEASER_CURRENT_TAG=${GORELEASER_CURRENT_TAG} \
--env-file .release-env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
Expand All @@ -229,7 +229,6 @@ goreleaser-check:
check
.PHONY: goreleaser-check

## prebuilt-binary: Create prebuilt binaries and attach them to GitHub release. Requires Docker.
prebuilt-binary:
@if [ ! -f ".release-env" ]; then \
echo "A .release-env file was not found but is required to create prebuilt binaries. This command is expected to be run in CI where a .release-env file exists. If you need to run this command locally to attach binaries to a release, you need to create a .release-env file with a Github token (classic) that has repo:public_repo scope."; \
Expand All @@ -238,7 +237,7 @@ prebuilt-binary:
docker run \
--rm \
--env CGO_ENABLED=1 \
--env GORELEASER_CURRENT_TAG=${GIT_TAG} \
--env GORELEASER_CURRENT_TAG=${GORELEASER_CURRENT_TAG} \
--env-file .release-env \
-v /var/run/docker.sock:/var/run/docker.sock \
-v `pwd`:/go/src/$(PACKAGE_NAME) \
Expand All @@ -247,7 +246,10 @@ prebuilt-binary:
release --clean
.PHONY: prebuilt-binary

## check-bbr: Check if your system uses BBR congestion control algorithm. Only works on Linux.
## goreleaser: Create prebuilt binaries and attach them to GitHub release. Requires Docker.
goreleaser: prebuilt-binary
.PHONY: goreleaser

check-bbr:
@echo "Checking if BBR is enabled..."
@if [ "$$(sysctl net.ipv4.tcp_congestion_control | awk '{print $$3}')" != "bbr" ]; then \
Expand All @@ -257,7 +259,10 @@ check-bbr:
fi
.PHONY: check-bbr

## enable-bbr: Enable BBR congestion control algorithm. Only works on Linux.
## bbr-check: Check if your system uses BBR congestion control algorithm. Only works on Linux.
bbr-check: check-bbr
.PHONY: bbr-check

enable-bbr:
@echo "Configuring system to use BBR..."
@if [ "$(sysctl net.ipv4.tcp_congestion_control | awk '{print $3}')" != "bbr" ]; then \
Expand All @@ -273,7 +278,10 @@ enable-bbr:
fi
.PHONY: enable-bbr

## disable-bbr: Disable BBR congestion control algorithm and revert to default.
## bbr-enable: Enable BBR congestion control algorithm. Only works on Linux.
bbr-enable: enable-bbr
.PHONY: bbr-enable

disable-bbr:
@echo "Disabling BBR and reverting to default congestion control algorithm..."
@if [ "$$(sysctl net.ipv4.tcp_congestion_control | awk '{print $$3}')" = "bbr" ]; then \
Expand All @@ -289,7 +297,10 @@ disable-bbr:
fi
.PHONY: disable-bbr

## enable-mptcp: Enable mptcp over multiple ports (not interfaces). Only works on Linux Kernel 5.6 and above.
## bbr-disable: Disable BBR congestion control algorithm and revert to default.
bbr-disable: disable-bbr
.PHONY: bbr-disable

enable-mptcp:
@echo "Configuring system to use mptcp..."
@sudo sysctl -w net.mptcp.enabled=1
Expand All @@ -300,10 +311,12 @@ enable-mptcp:
@echo "net.mptcp.mptcp_path_manager=ndiffports" | sudo tee -a /etc/sysctl.conf
@echo "net.mptcp.mptcp_ndiffports=16" | sudo tee -a /etc/sysctl.conf
@echo "MPTCP configuration complete and persistent!"

.PHONY: enable-mptcp

## disable-mptcp: Disables mptcp over multiple ports. Only works on Linux Kernel 5.6 and above.
## mptcp-enable: Enable mptcp over multiple ports (not interfaces). Only works on Linux Kernel 5.6 and above.
mptcp-enable: enable-mptcp
.PHONY: mptcp-enable

disable-mptcp:
@echo "Disabling MPTCP..."
@sudo sysctl -w net.mptcp.enabled=0
Expand All @@ -313,9 +326,11 @@ disable-mptcp:
@sudo sed -i '/net.mptcp.mptcp_path_manager=ndiffports/d' /etc/sysctl.conf
@sudo sed -i '/net.mptcp.mptcp_ndiffports=16/d' /etc/sysctl.conf
@echo "MPTCP configuration reverted!"

.PHONY: disable-mptcp

## mptcp-disable: Disable mptcp over multiple ports. Only works on Linux Kernel 5.6 and above.
mptcp-disable: disable-mptcp

CONFIG_FILE ?= ${HOME}/.celestia-app/config/config.toml
SEND_RECV_RATE ?= 10485760 # 10 MiB

Expand All @@ -331,10 +346,3 @@ configure-v3:
sed -i "s/ttl-num-blocks = .*/ttl-num-blocks = 12/" $(CONFIG_FILE); \
fi
.PHONY: configure-v3


## debug-version: Print the git tag and version.
debug-version:
@echo "GIT_TAG: $(GIT_TAG)"
@echo "VERSION: $(VERSION)"
.PHONY: debug-version
Loading

0 comments on commit 63fc9ab

Please sign in to comment.