Skip to content

Commit

Permalink
Merge branch 'main' into thiserror-no-std
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Nov 29, 2024
2 parents 92e6a17 + 88bde87 commit b051d58
Show file tree
Hide file tree
Showing 688 changed files with 19,798 additions and 12,404 deletions.
6 changes: 3 additions & 3 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ crates/fs-util/ @onbjerg @emhane
crates/metrics/ @onbjerg
crates/net/ @emhane @mattsse @Rjected
crates/net/downloaders/ @onbjerg @rkrasiuk @emhane
crates/node/ @mattsse @Rjected @onbjerg
crates/node/ @mattsse @Rjected @onbjerg @emhane @klkvr
crates/optimism/ @mattsse @Rjected @fgimenez @emhane
crates/payload/ @mattsse @Rjected
crates/primitives/ @Rjected
crates/primitives-traits/ @Rjected @joshieDo
crates/primitives/ @Rjected @emhane @mattsse @klkvr
crates/primitives-traits/ @Rjected @joshieDo @emhane @mattsse @klkvr
crates/prune/ @shekhirin @joshieDo
crates/revm/ @mattsse @rakita
crates/rpc/ @mattsse @Rjected @emhane
Expand Down
61 changes: 61 additions & 0 deletions .github/assets/check_rv32imac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/usr/bin/env bash
set +e # Disable immediate exit on error

# Array of crates to check
crates_to_check=(
reth-codecs-derive
# reth-evm
# reth-primitives
# reth-primitives-traits
# reth-optimism-forks
# reth-optimism-chainspec
)

# Array to hold the results
results=()
# Flag to track if any command fails
any_failed=0

for crate in "${crates_to_check[@]}"; do
cmd="cargo +stable build -p $crate --target riscv32imac-unknown-none-elf --no-default-features"

if [ -n "$CI" ]; then
echo "::group::$cmd"
else
printf "\n%s:\n %s\n" "$crate" "$cmd"
fi

set +e # Disable immediate exit on error
# Run the command and capture the return code
$cmd
ret_code=$?
set -e # Re-enable immediate exit on error

# Store the result in the dictionary
if [ $ret_code -eq 0 ]; then
results+=("1:✅:$crate")
else
results+=("2:❌:$crate")
any_failed=1
fi

if [ -n "$CI" ]; then
echo "::endgroup::"
fi
done

# Sort the results by status and then by crate name
IFS=$'\n' sorted_results=($(sort <<<"${results[*]}"))
unset IFS

# Print summary
echo -e "\nSummary of build results:"
for result in "${sorted_results[@]}"; do
status="${result#*:}"
status="${status%%:*}"
crate="${result##*:}"
echo "$status $crate"
done

# Exit with a non-zero status if any command fails
exit $any_failed
8 changes: 2 additions & 6 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ exclude_crates=(
reth-beacon-consensus
reth-bench
reth-blockchain-tree
reth-chain-state
reth-cli
reth-cli-commands
reth-cli-runner
Expand All @@ -26,13 +25,11 @@ exclude_crates=(
reth-dns-discovery
reth-downloaders
reth-e2e-test-utils
reth-engine-primitives
reth-engine-service
reth-engine-tree
reth-engine-util
reth-eth-wire
reth-ethereum-cli
reth-ethereum-engine-primitives
reth-ethereum-payload-builder
reth-etl
reth-exex
Expand All @@ -41,7 +38,6 @@ exclude_crates=(
reth-net-nat
reth-network
reth-node-api
reth-node-types
reth-node-builder
reth-node-core
reth-node-ethereum
Expand All @@ -51,8 +47,7 @@ exclude_crates=(
reth-optimism-node
reth-optimism-payload-builder
reth-optimism-rpc
reth-payload-builder
reth-payload-primitives
reth-optimism-primitives
reth-rpc
reth-rpc-api
reth-rpc-api-testing-util
Expand All @@ -74,6 +69,7 @@ exclude_crates=(
reth-static-file # tokio
reth-transaction-pool # c-kzg
reth-trie-parallel # tokio
reth-testing-utils
)

# Array to hold the results
Expand Down
3 changes: 2 additions & 1 deletion .github/assets/hive/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ COPY dist/reth /usr/local/bin
COPY LICENSE-* ./

EXPOSE 30303 30303/udp 9001 8545 8546
ENTRYPOINT ["/usr/local/bin/reth"]
ENV RUST_LOG=debug
ENTRYPOINT ["/usr/local/bin/reth"]
2 changes: 0 additions & 2 deletions .github/assets/kurtosis_network_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ participants:
- el_type: geth
cl_type: lighthouse
- el_type: reth
el_extra_params:
- --engine.experimental
el_image: "ghcr.io/paradigmxyz/reth:kurtosis-ci"
cl_type: teku
additional_services:
Expand Down
15 changes: 15 additions & 0 deletions .github/assets/kurtosis_op_network_params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ethereum_package:
participants:
- el_type: reth
cl_type: lighthouse
optimism_package:
chains:
- participants:
- el_type: op-geth
cl_type: op-node
- el_type: op-reth
el_image: "ghcr.io/paradigmxyz/op-reth:kurtosis-ci"
cl_type: op-node
batcher_params:
extra_params:
- "--throttle-interval=0"
4 changes: 2 additions & 2 deletions .github/workflows/hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name: hive
on:
workflow_dispatch:
schedule:
# every day
- cron: "0 0 * * *"
# run every 12 hours
- cron: "0 */12 * * *"

env:
CARGO_TERM_COLOR: always
Expand Down
121 changes: 121 additions & 0 deletions .github/workflows/kurtosis-op.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Runs simple OP stack setup in Kurtosis

name: kurtosis-op

on:
workflow_dispatch:
schedule:
# every day
- cron: "0 1 * * *"

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
prepare-reth:
if: github.repository == 'paradigmxyz/reth'
timeout-minutes: 45
runs-on:
group: Reth
steps:
- uses: actions/checkout@v4
- run: mkdir artifacts
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- name: Build reth
run: |
cargo build --features optimism,asm-keccak --profile hivetests --bin op-reth --manifest-path crates/optimism/bin/Cargo.toml --locked
mkdir dist && cp ./target/hivetests/op-reth ./dist/reth
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and export reth image
uses: docker/build-push-action@v6
with:
context: .
file: .github/assets/hive/Dockerfile
tags: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
outputs: type=docker,dest=./artifacts/reth_image.tar
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Upload reth image
uses: actions/upload-artifact@v4
with:
name: artifacts
path: ./artifacts

test:
timeout-minutes: 60
strategy:
fail-fast: false
name: run kurtosis
runs-on:
group: Reth
needs:
- prepare-reth
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download reth image
uses: actions/download-artifact@v4
with:
name: artifacts
path: /tmp

- name: Load Docker image
run: |
docker load -i /tmp/reth_image.tar &
wait
docker image ls -a
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run kurtosis
run: |
echo "deb [trusted=yes] https://apt.fury.io/kurtosis-tech/ /" | sudo tee /etc/apt/sources.list.d/kurtosis.list
sudo apt update
sudo apt install kurtosis-cli
kurtosis engine start
kurtosis run --enclave op-devnet github.com/ethpandaops/optimism-package --args-file .github/assets/kurtosis_op_network_params.yaml
ENCLAVE_ID=$(curl http://127.0.0.1:9779/api/enclaves | jq --raw-output 'keys[0]')
GETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-1-op-geth-op-node-op-kurtosis".public_ports.rpc.number')
RETH_PORT=$(curl "http://127.0.0.1:9779/api/enclaves/$ENCLAVE_ID/services" | jq '."op-el-2-op-reth-op-node-op-kurtosis".public_ports.rpc.number')
echo "GETH_RPC=http://127.0.0.1:$GETH_PORT" >> $GITHUB_ENV
echo "RETH_RPC=http://127.0.0.1:$RETH_PORT" >> $GITHUB_ENV
- name: Assert that clients advance
run: |
for i in {1..100}; do
sleep 5
BLOCK_GETH=$(cast bn --rpc-url $GETH_RPC)
BLOCK_RETH=$(cast bn --rpc-url $RETH_RPC)
if [ $BLOCK_GETH -ge 100 ] && [ $BLOCK_RETH -ge 100 ] ; then exit 0; fi
echo "Waiting for clients to advance..., Reth: $BLOCK_RETH Geth: $BLOCK_GETH"
done
kurtosis service logs -a op-devnet op-el-2-op-reth-op-node-op-kurtosis
kurtosis service logs -a op-devnet op-cl-2-op-node-op-reth-op-kurtosis
exit 1
notify-on-error:
needs: test
if: failure()
runs-on:
group: Reth
steps:
- name: Slack Webhook Action
uses: rtCamp/action-slack-notify@v2
env:
SLACK_COLOR: ${{ job.status }}
SLACK_MESSAGE: "Failed run: https://github.com/paradigmxyz/reth/actions/runs/${{ github.run_id }}"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
4 changes: 2 additions & 2 deletions .github/workflows/kurtosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name: kurtosis
on:
workflow_dispatch:
schedule:
# every day
- cron: "0 1 * * *"
# run every 12 hours
- cron: "0 */12 * * *"

env:
CARGO_TERM_COLOR: always
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,26 @@ jobs:
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: dcarbone/install-jq-action@v2
- uses: dcarbone/install-jq-action@v3
- name: Run Wasm checks
run: .github/assets/check_wasm.sh

riscv:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: riscv32imac-unknown-none-elf
- uses: taiki-e/install-action@cargo-hack
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
- uses: dcarbone/install-jq-action@v3
- name: Run RISC-V checks
run: .github/assets/check_rv32imac.sh

crate-checks:
runs-on: ubuntu-latest
timeout-minutes: 30
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
partition: 2
total_partitions: 2
- type: optimism
args: --features "asm-keccak optimism" --locked
args: --features "asm-keccak optimism" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum"
partition: 1
total_partitions: 2
- type: optimism
args: --features "asm-keccak optimism" --locked
args: --features "asm-keccak optimism" --locked --exclude reth --exclude reth-bench --exclude "example-*" --exclude "reth-ethereum-*" --exclude "*-ethereum"
partition: 2
total_partitions: 2
- type: book
Expand All @@ -61,7 +61,8 @@ jobs:
- name: Run tests
run: |
cargo nextest run \
${{ matrix.args }} --workspace --exclude ef-tests \
${{ matrix.args }} --workspace \
--exclude ef-tests --no-tests=warn \
--partition hash:${{ matrix.partition }}/2 \
-E "!kind(test)"
Expand Down
Loading

0 comments on commit b051d58

Please sign in to comment.