Skip to content

Commit

Permalink
Merge pull request #51 from bitfinity-network/merge_upstream_v1.1.4
Browse files Browse the repository at this point in the history
Merge upstream v1.1.4
  • Loading branch information
ufoscout authored Dec 24, 2024
2 parents bc308a6 + dda6ae6 commit 5bb1291
Show file tree
Hide file tree
Showing 1,492 changed files with 118,407 additions and 55,481 deletions.
41 changes: 41 additions & 0 deletions .config/zepter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
version:
format: 1
# Minimum zepter version that is expected to work. This is just for printing a nice error
# message when someone tries to use an older version.
binary: 0.13.2

# The examples in the following comments assume crate `A` to have a dependency on crate `B`.
workflows:
check:
- [
"lint",
# Check that `A` activates the features of `B`.
"propagate-feature",
# These are the features to check:
"--features=std,optimism,dev,asm-keccak,jemalloc,jemalloc-prof,tracy-allocator,serde-bincode-compat,serde,test-utils,arbitrary,bench",
# Do not try to add a new section into `[features]` of `A` only because `B` expose that feature. There are edge-cases where this is still needed, but we can add them manually.
"--left-side-feature-missing=ignore",
# Ignore the case that `A` it outside of the workspace. Otherwise it will report errors in external dependencies that we have no influence on.

"--left-side-outside-workspace=ignore",
# Auxillary flags:
"--offline",
"--locked",
"--show-path",
"--quiet",
]
default:
# Running `zepter` with no subcommand will check & fix.
- [$check.0, "--fix"]

# Will be displayed when any workflow fails:
help:
text: |
Reth uses the Zepter CLI to detect abnormalities in Cargo features, e.g. missing propagation.
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:
- "https://github.com/paradigmxyz/reth/pull/11888"
- "https://github.com/ggwpez/zepter"
19 changes: 10 additions & 9 deletions CODEOWNERS → .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
bin/ @onbjerg
crates/blockchain-tree/ @rakita @rkrasiuk @mattsse @Rjected
crates/blockchain-tree-api/ @rakita @rkrasiuk @mattsse @Rjected
crates/chainspec/ @Rjected @joshieDo @mattsse
crates/chainspec/ @Rjected @joshieDo @mattsse @emhane
crates/chain-state/ @fgimenez @mattsse @rkrasiuk
crates/cli/ @onbjerg @mattsse
crates/config/ @onbjerg
crates/consensus/ @rkrasiuk @mattsse @Rjected
Expand All @@ -13,18 +14,17 @@ crates/errors/ @mattsse
crates/ethereum/ @mattsse @Rjected
crates/ethereum-forks/ @mattsse @Rjected
crates/etl/ @joshieDo @shekhirin
crates/evm/ @rakita @mattsse @Rjected @DaniPopes
crates/evm/ @rakita @mattsse @Rjected
crates/exex/ @onbjerg @shekhirin
crates/fs-util/ @onbjerg @DaniPopes @emhane
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-core/ @mattsse @Rjected @onbjerg
crates/optimism/ @mattsse @Rjected @fgimenez
crates/node/ @mattsse @Rjected @onbjerg @emhane @klkvr
crates/optimism/ @mattsse @Rjected @fgimenez @emhane
crates/payload/ @mattsse @Rjected
crates/primitives/ @DaniPopes @Rjected
crates/primitives-traits/ @DaniPopes @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 All @@ -43,5 +43,6 @@ crates/tasks/ @mattsse
crates/tokio-util/ @fgimenez @emhane
crates/tracing/ @onbjerg
crates/transaction-pool/ @mattsse
crates/trie/ @rkrasiuk @Rjected
crates/trie/ @rkrasiuk @Rjected @shekhirin
etc/ @Rjected @onbjerg @shekhirin
.github/ @onbjerg @gakonst @DaniPopes
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
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: GitHub Discussions
url: https://github.com/foundry-rs/reth/discussions
url: https://github.com/paradigmxyz/reth/discussions
about: Please ask and answer questions here to keep the issue tracker clean.
- name: Security
url: mailto:[email protected]
about: Please report security vulnerabilities here.
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
142 changes: 142 additions & 0 deletions .github/assets/check_wasm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#!/usr/bin/env bash
set +e # Disable immediate exit on error

# Array of crates to compile
crates=($(cargo metadata --format-version=1 --no-deps | jq -r '.packages[].name' | grep '^reth' | sort))

# Array of crates to exclude
# Used with the `contains` function.
# shellcheck disable=SC2034
exclude_crates=(
# The following are not working yet, but known to be fixable
reth-exex-types # https://github.com/paradigmxyz/reth/issues/9946
# The following require investigation if they can be fixed
reth-basic-payload-builder
reth-beacon-consensus
reth-bench
reth-blockchain-tree
reth-cli
reth-cli-commands
reth-cli-runner
reth-consensus-debug-client
reth-db-common
reth-discv4
reth-discv5
reth-dns-discovery
reth-downloaders
reth-e2e-test-utils
reth-engine-service
reth-engine-tree
reth-engine-util
reth-eth-wire
reth-ethereum-cli
reth-ethereum-payload-builder
reth-etl
reth-exex
reth-exex-test-utils
reth-ipc
reth-net-nat
reth-network
reth-node-api
reth-node-builder
reth-node-core
reth-node-ethereum
reth-node-events
reth-node-metrics
reth-optimism-cli
reth-optimism-node
reth-optimism-payload-builder
reth-optimism-rpc
reth-optimism-primitives
reth-rpc
reth-rpc-api
reth-rpc-api-testing-util
reth-rpc-builder
reth-rpc-engine-api
reth-rpc-eth-api
reth-rpc-eth-types
reth-rpc-layer
reth-stages
reth-engine-local
# The following are not supposed to be working
reth # all of the crates below
reth-invalid-block-hooks # reth-provider
reth-libmdbx # mdbx
reth-mdbx-sys # mdbx
reth-provider # tokio
reth-prune # tokio
reth-stages-api # reth-provider, reth-prune
reth-static-file # tokio
reth-transaction-pool # c-kzg
reth-trie-parallel # tokio
reth-testing-utils
reth-network-peers
)

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

# Function to check if a value exists in an array
contains() {
local array="$1[@]"
local seeking=$2
local in=1
for element in "${!array}"; do
if [[ "$element" == "$seeking" ]]; then
in=0
break
fi
done
return $in
}

for crate in "${crates[@]}"; do
if contains exclude_crates "$crate"; then
results+=("3:⏭️:$crate")
continue
fi

cmd="cargo +stable build -p $crate --target wasm32-wasip1 --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
9 changes: 9 additions & 0 deletions .github/assets/hive/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu

COPY dist/reth /usr/local/bin

COPY LICENSE-* ./

EXPOSE 30303 30303/udp 9001 8545 8546
ENV RUST_LOG=debug
ENTRYPOINT ["/usr/local/bin/reth"]
38 changes: 38 additions & 0 deletions .github/assets/hive/build_simulators.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
set -eo pipefail

# Create the hive_assets directory
mkdir hive_assets/

cd hivetests
go build .

./hive -client reth # first builds and caches the client

# Run each hive command in the background for each simulator and wait
echo "Building images"
./hive -client reth --sim "pyspec" -sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/engine" -sim.timelimit 1s || true &
./hive -client reth --sim "devp2p" -sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/rpc-compat" -sim.timelimit 1s || true &
./hive -client reth --sim "smoke/genesis" -sim.timelimit 1s || true &
./hive -client reth --sim "smoke/network" -sim.timelimit 1s || true &
./hive -client reth --sim "ethereum/sync" -sim.timelimit 1s || true &
wait

# Run docker save in parallel and wait
echo "Saving images"
docker save hive/hiveproxy:latest -o ../hive_assets/hiveproxy.tar &
docker save hive/simulators/devp2p:latest -o ../hive_assets/devp2p.tar &
docker save hive/simulators/ethereum/engine:latest -o ../hive_assets/engine.tar &
docker save hive/simulators/ethereum/rpc-compat:latest -o ../hive_assets/rpc_compat.tar &
docker save hive/simulators/ethereum/pyspec:latest -o ../hive_assets/pyspec.tar &
docker save hive/simulators/smoke/genesis:latest -o ../hive_assets/smoke_genesis.tar &
docker save hive/simulators/smoke/network:latest -o ../hive_assets/smoke_network.tar &
docker save hive/simulators/ethereum/sync:latest -o ../hive_assets/ethereum_sync.tar &
wait

# Make sure we don't rebuild images on the CI jobs
git apply ../.github/assets/hive/no_sim_build.diff
go build .
mv ./hive ../hive_assets/
Loading

0 comments on commit 5bb1291

Please sign in to comment.