Skip to content

Commit

Permalink
Merge pull request #93 from scroll-tech/chore-scroll-merge-upstream-a…
Browse files Browse the repository at this point in the history
…bc4ff977

Chore scroll merge upstream abc4ff9
  • Loading branch information
frisitano authored Dec 23, 2024
2 parents bb82d3b + b42d9a0 commit 5b55f0c
Show file tree
Hide file tree
Showing 678 changed files with 18,889 additions and 13,811 deletions.
2 changes: 1 addition & 1 deletion .config/zepter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ help:
text: |
Reth uses the Zepter CLI to detect abnormalities in Cargo features, e.g. missing propagation.
It looks like one more more checks failed; please check the console output.
It looks like one more checks failed; please check the console output.
You can try to automatically address them by installing zepter (`cargo install zepter --locked`) and simply running `zepter` in the workspace root.
links:
Expand Down
12 changes: 12 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ body:
- Mac (Apple Silicon)
- Windows (x86)
- Windows (ARM)
- type: dropdown
id: container_type
attributes:
label: Container Type
description: Were you running it in a container?
multiple: true
options:
- Not running in a container
- Docker
- Kubernetes
- LXC/LXD
- Other
validations:
required: true
- type: textarea
Expand Down
64 changes: 64 additions & 0 deletions .github/assets/check_rv32imac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/usr/bin/env bash
set +e # Disable immediate exit on error

# Array of crates to check
crates_to_check=(
reth-codecs-derive
reth-ethereum-forks
reth-ethereum-primitives
reth-primitives-traits
reth-optimism-forks
reth-network-peers
# reth-evm
# reth-primitives
# 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
1 change: 1 addition & 0 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ exclude_crates=(
reth-transaction-pool # c-kzg
reth-trie-parallel # tokio
reth-testing-utils
reth-network-peers
reth-scroll-cli # tokio
reth-scroll-node # tokio
reth-scroll # tokio
Expand Down
6 changes: 0 additions & 6 deletions .github/assets/hive/expected_failures.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ rpc-compat:
- eth_getTransactionReceipt/get-access-list (reth)
- eth_getTransactionReceipt/get-blob-tx (reth)
- eth_getTransactionReceipt/get-dynamic-fee (reth)
- eth_getBlockByHash/get-block-by-hash (reth)
- eth_getBlockByNumber/get-block-n (reth)
- eth_getBlockByNumber/get-finalized (reth)
- eth_getBlockByNumber/get-genesis (reth)
- eth_getBlockByNumber/get-latest (reth)
- eth_getBlockByNumber/get-safe (reth)

# https://github.com/paradigmxyz/reth/issues/8732
engine-withdrawals:
Expand Down
21 changes: 10 additions & 11 deletions .github/assets/hive/no_sim_build.diff
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
diff --git a/internal/libdocker/builder.go b/internal/libdocker/builder.go
index 4731c9d..d717f52 100644
index e4bf99b6..2023f7e2 100644
--- a/internal/libdocker/builder.go
+++ b/internal/libdocker/builder.go
@@ -7,9 +7,7 @@ import (
"fmt"
@@ -8,7 +8,6 @@ import (
"io"
"io/fs"
"log/slog"
- "os"
"path/filepath"
- "strings"

"github.com/ethereum/hive/internal/libhive"
docker "github.com/fsouza/go-dockerclient"
@@ -53,24 +51,8 @@ func (b *Builder) BuildClientImage(ctx context.Context, client libhive.ClientDes
"slices"
"strings"
@@ -49,25 +48,8 @@ func (b *Builder) BuildClientImage(ctx context.Context, client libhive.ClientDes

// BuildSimulatorImage builds a docker image of a simulator.
func (b *Builder) BuildSimulatorImage(ctx context.Context, name string) (string, error) {
func (b *Builder) BuildSimulatorImage(ctx context.Context, name string, buildArgs map[string]string) (string, error) {
- dir := b.config.Inventory.SimulatorDirectory(name)
- buildContextPath := dir
- buildDockerfile := "Dockerfile"
-
- // build context dir of simulator can be overridden with "hive_context.txt" file containing the desired build path
- if contextPathBytes, err := os.ReadFile(filepath.Join(filepath.FromSlash(dir), "hive_context.txt")); err == nil {
- buildContextPath = filepath.Join(dir, strings.TrimSpace(string(contextPathBytes)))
Expand All @@ -32,14 +31,14 @@ index 4731c9d..d717f52 100644
- }
- }
tag := fmt.Sprintf("hive/simulators/%s:latest", name)
- err := b.buildImage(ctx, buildContextPath, buildDockerfile, tag, nil)
- err := b.buildImage(ctx, buildContextPath, buildDockerfile, tag, buildArgs)
- return tag, err
+ return tag, nil
}

// BuildImage creates a container by archiving the given file system,
diff --git a/internal/libdocker/proxy.go b/internal/libdocker/proxy.go
index a53e5af..0bb2ea9 100644
index d3a14ae6..8779671e 100644
--- a/internal/libdocker/proxy.go
+++ b/internal/libdocker/proxy.go
@@ -16,7 +16,7 @@ const hiveproxyTag = "hive/hiveproxy"
Expand Down
35 changes: 4 additions & 31 deletions .github/workflows/hive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,10 @@ concurrency:

jobs:
prepare-reth:
if: github.repository == 'paradigmxyz/reth'
timeout-minutes: 45
runs-on: ubuntu-latest
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 asm-keccak --profile hivetests --bin reth --locked
mkdir dist && cp ./target/hivetests/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/reth:latest
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
uses: ./.github/workflows/prepare-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/reth:latest
binary_name: reth

prepare-hive:
if: github.repository == 'paradigmxyz/reth'
Expand Down
42 changes: 8 additions & 34 deletions .github/workflows/kurtosis-op.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ name: kurtosis-op
on:
workflow_dispatch:
schedule:
# every day
- cron: "0 1 * * *"
# run every 12 hours
- cron: "0 */12 * * *"

env:
CARGO_TERM_COLOR: always
Expand All @@ -17,38 +17,12 @@ concurrency:

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
uses: ./.github/workflows/prepare-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/op-reth:kurtosis-ci
binary_name: op-reth
cargo_features: optimism,asm-keccak
cargo_package: crates/optimism/bin/Cargo.toml

test:
timeout-minutes: 60
Expand Down
36 changes: 4 additions & 32 deletions .github/workflows/kurtosis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,38 +17,10 @@ concurrency:

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 asm-keccak --profile hivetests --bin reth --locked
mkdir dist && cp ./target/hivetests/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/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
uses: ./.github/workflows/prepare-reth.yml
with:
image_tag: ghcr.io/paradigmxyz/reth:kurtosis-ci
binary_name: reth

test:
timeout-minutes: 60
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,22 @@ jobs:
- 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 Expand Up @@ -245,6 +261,9 @@ jobs:
zepter --version
time zepter run check
deny:
uses: ithacaxyz/ci/.github/workflows/deny.yml@main

lint-success:
name: lint success
runs-on: ubuntu-latest
Expand All @@ -263,6 +282,7 @@ jobs:
- no-test-deps
- features
- feature-propagation
- deny
timeout-minutes: 30
steps:
- name: Decide whether the needed jobs succeeded or failed
Expand Down
Loading

0 comments on commit 5b55f0c

Please sign in to comment.