Skip to content

Commit

Permalink
Merge pull request #1318 from chainwayxyz/nightly
Browse files Browse the repository at this point in the history
Release v0.5.3
  • Loading branch information
eyusufatik authored Oct 9, 2024
2 parents 7bce5b6 + 341f241 commit d5211cb
Show file tree
Hide file tree
Showing 128 changed files with 3,880 additions and 4,152 deletions.
4 changes: 2 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

# include source files
!/bin
!/resources/configs
!/crates
!/resources/hive
!/resources
!Cargo.lock
!Cargo.toml
!deny.toml
Expand All @@ -15,6 +14,7 @@
!packages_to_publish.yml
!rust-toolchain.toml
!rustfmt.toml
!/da-db

# include for vergen constants
!/.git
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ jobs:
RUST_BACKTRACE: 1
USE_DOCKER: "true"
SHORT_PREFIX: 1
CITREA_E2E_TEST_BINARY: ${{ github.workspace }}/target/debug/citrea
- name: Upload coverage
uses: codecov/codecov-action@v4
with:
Expand Down Expand Up @@ -256,7 +257,6 @@ jobs:
sleep 2
RUST_LOG=off ./target/release/citrea --rollup-config-path resources/configs/mock/rollup_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
./resources/configs/mock-dockerized/publish_da_block.sh &
cd ./bin/citrea/tests/evm/uniswap
npx hardhat run --network citrea scripts/01_deploy.js
npx hardhat run --network citrea scripts/02_swap.js
Expand Down Expand Up @@ -298,7 +298,6 @@ jobs:
sleep 2
RUST_LOG=off ./target/release/citrea --da-layer mock --rollup-config-path resources/configs/mock/rollup_config.toml --genesis-paths resources/genesis/mock/ &
sleep 2
# ./resources/configs/mock-dockerized/publish_da_block.sh &
cd ./bin/citrea/tests/evm/web3_py
python test.py
Expand Down Expand Up @@ -397,6 +396,7 @@ jobs:
BONSAI_API_KEY: ${{ secrets.BONSAI_API_KEY }} # TODO: remove this once we don't use the client on tests
USE_DOCKER: "true"
SHORT_PREFIX: 1
CITREA_E2E_TEST_BINARY: ${{ github.workspace }}/target/debug/citrea

system-contracts:
strategy:
Expand Down Expand Up @@ -442,7 +442,9 @@ jobs:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly
# https://github.com/foundry-rs/foundry/releases/tag/nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc
# This is the latest version known to work for us
version: nightly-25f24e677a6a32a62512ad4f561995589ac2c7dc

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
182 changes: 182 additions & 0 deletions .github/workflows/nightly_build_push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
name: nightly-build-and-push

on:
push:
branches:
- nightly

env:
EXPECTED_BITCOIN_DA_ID: ${{ vars.EXPECTED_BITCOIN_DA_ID }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IMAGE_TAG: ${{ github.sha }}

jobs:

validate_DA_ID_format:
runs-on: ubuntu-latest
steps:
- name: Validate EXPECTED_BITCOIN_DA_ID format
run: |
echo "Raw EXPECTED_BITCOIN_DA_ID value:"
echo "$EXPECTED_BITCOIN_DA_ID"
echo "Length of EXPECTED_BITCOIN_DA_ID: ${#EXPECTED_BITCOIN_DA_ID}"
if [ -z "${EXPECTED_BITCOIN_DA_ID// }" ]; then
echo "Error: EXPECTED_BITCOIN_DA_ID is not set, empty, or contains only spaces"
exit 1
fi
# Remove any trailing newline or carriage return
EXPECTED_BITCOIN_DA_ID=$(echo "$EXPECTED_BITCOIN_DA_ID" | tr -d '\n\r')
# Count commas and spaces
comma_count=$(echo "$EXPECTED_BITCOIN_DA_ID" | tr -cd ',' | wc -c)
space_count=$(echo "$EXPECTED_BITCOIN_DA_ID" | tr -cd ' ' | wc -c)
echo "Number of commas: $comma_count"
echo "Number of spaces: $space_count"
# Split the string into an array and trim each element
IFS=', ' read -ra raw_numbers <<< "$EXPECTED_BITCOIN_DA_ID"
numbers=()
for num in "${raw_numbers[@]}"; do
trimmed_num=$(echo "$num" | tr -d '[:space:]') # Remove all whitespace
numbers+=("$trimmed_num")
done
echo "Number of elements after splitting and trimming: ${#numbers[@]}"
# Check if there are exactly 8 numbers
if [ ${#numbers[@]} -ne 8 ]; then
echo "Error: EXPECTED_BITCOIN_DA_ID should contain exactly 8 numbers"
echo "Actual number of elements: ${#numbers[@]}"
exit 1
fi
# Check if all numbers are valid u32
for i in "${!numbers[@]}"; do
num=${numbers[$i]}
echo "Checking number $((i+1)): '$num'"
echo "Hex representation: $(echo -n "$num" | xxd -p)"
if ! [[ $num =~ ^[0-9]+$ ]]; then
echo "Error: '$num' is not composed of digits only"
exit 1
fi
if [ $num -gt 4294967295 ]; then
echo "Error: '$num' is greater than 4294967295"
exit 1
fi
done
# Reconstruct the trimmed DA_ID
trimmed_da_id=$(IFS=', '; echo "${numbers[*]}")
# Final check
if [ $comma_count -eq 7 ] && [ $space_count -eq 7 ] && [ ${#numbers[@]} -eq 8 ]; then
echo "EXPECTED_BITCOIN_DA_ID is valid:"
echo "- Contains 7 commas"
echo "- Contains 7 spaces"
echo "- Contains 8 valid u32 numbers"
echo "Original value: $EXPECTED_BITCOIN_DA_ID"
echo "Trimmed value: $trimmed_da_id"
else
echo "Error: EXPECTED_BITCOIN_DA_ID format is incorrect"
echo "- Comma count: $comma_count (should be 7)"
echo "- Space count: $space_count (should be 7)"
echo "- Number count: ${#numbers[@]} (should be 8)"
exit 1
fi
linux_amd64_binary_extraction:
needs: validate_DA_ID_format
runs-on: ubicloud-standard-30
strategy:
matrix:
include:
- short_prefix: 1
short_prefix_value: "-short-prefix"
- short_prefix: 0
short_prefix_value: ""
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Dependencies
run: |
sudo apt update && sudo apt -y install curl gcc cpp cmake clang llvm
sudo apt -y autoremove && sudo apt clean && sudo rm -rf /var/lib/apt/lists/*
- name: Install Rust
run: |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
rustup install 1.79.0
rustup default 1.79.0
- name: Install Cargo Binstall
run: |
cargo install --version 1.7.0 cargo-binstall
- name: Install cargo-risczero
run: |
cargo binstall [email protected] --no-confirm
- name: Install risc0-zkvm toolchain
run: cargo risczero install --version r0.1.79.0-2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Project
env:
REPR_GUEST_BUILD: 1
SHORT_PREFIX: ${{ matrix.short_prefix }}
SKIP_GUEST_BUILD: 0
run: |
cargo build --release
- name: Check BITCOIN_DA_ID
id: check-id
run: |
RESULT=$(grep -R "BITCOIN_DA_ID" target/ || echo "Grep failed")
EXPECTED_BITCOIN_DA_ID=$(echo "${{ env.EXPECTED_BITCOIN_DA_ID }}" | tr -d '\n\r')
if echo "$RESULT" | grep -q "$EXPECTED_BITCOIN_DA_ID"; then
echo "Check passed successfully."
echo "Expected: BITCOIN_DA_ID ${{ env.EXPECTED_BITCOIN_DA_ID }} "
echo "Actual: $RESULT"
else
echo "Check failed. Expected: BITCOIN_DA_ID ${{ env.EXPECTED_BITCOIN_DA_ID }} "
echo "Actual: $RESULT"
exit 1
fi
- name: Copy binary to build-push/nightly
run: |
cp target/release/citrea build-push/nightly/citrea
chmod +x build-push/nightly/citrea
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Docker image
uses: docker/build-push-action@v6
with:
file: ./build-push/nightly/Dockerfile
context: ./build-push/nightly
tags: ${{ vars.DOCKERHUB_USERNAME }}/citrea:${{ env.IMAGE_TAG }}${{ matrix.short_prefix_value }}
platforms: linux/amd64
push: true
load: false
provenance: false



8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## v0.5.3 (2024-10-10)
- `eth_call` RPC now supports state and block overrides. ([#1270](https://github.com/chainwayxyz/citrea/pull/1270))
- `eth_call`, `eth_estimateGas` and `eth_createAccessList` RPCs now supports "pending" block tag. ([#1303](https://github.com/chainwayxyz/citrea/pull/1303))
- Bitcoin DA adapter uses mempool.space API for fee estimation. ([#1302](https://github.com/chainwayxyz/citrea/pull/1302))
- New RPC for prover node: `prover_generateInput`. ([#1280](https://github.com/chainwayxyz/citrea/pull/1280))
- Enhance `eth_estimateGas` RPC L1 fee estimatation. ([#1261](https://github.com/chainwayxyz/citrea/pull/1261))
- Structured concurrency and graceful shutdown: fixes breaking storage on shutdown while syncing for the first time. ([#1214](https://github.com/chainwayxyz/citrea/pull/1214) and [#1216](https://github.com/chainwayxyz/citrea/pull/1216))

## v0.5.2 (2024-09-30)
- Added config for disableing prover proving session recovery. ([#1241](https://github.com/chainwayxyz/citrea/pull/1241))
- Nodes now log each RPC request and response. ([#1236](https://github.com/chainwayxyz/citrea/pull/1236))
Expand Down
Loading

0 comments on commit d5211cb

Please sign in to comment.