Skip to content

Commit

Permalink
Merge branch 'main' into l2/restart_processes
Browse files Browse the repository at this point in the history
  • Loading branch information
fborello-lambda committed Nov 25, 2024
2 parents fa94818 + 2330a51 commit f88f0b2
Show file tree
Hide file tree
Showing 66 changed files with 2,338 additions and 909 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/asertoor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: "Assertoor"
on:
merge_group:
pull_request:
branches: ["**"]
paths-ignore:
- 'README.md'
- 'LICENSE'
- "**/README.md"
- "**/docs/**"

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

env:
RUST_VERSION: 1.80.1

jobs:
build:
uses: ./.github/workflows/docker_build.yaml

run-assertoor:
name: Stability Check
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4

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

- name: Load image
run: |
docker load --input /tmp/ethrex_image.tar
- name: Setup kurtosis testnet and run assertoor tests
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
kurtosis_version: '1.3.1'
ethereum_package_url: 'github.com/lambdaclass/ethereum-package'
ethereum_package_branch: 'ethrex-integration'
ethereum_package_args: './test_data/network_params.yaml'
8 changes: 1 addition & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,11 @@ jobs:
run: |
make download-test-vectors
- name: Run L2 integration test
run: |
cd crates/l2
cp .env.example .env
make test
- name: Run tests
run: |
make test
docker-build:
docker_build:
name: Build Docker image
runs-on: ubuntu-latest
steps:
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/ci_l2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI L2
on:
merge_group:
pull_request:
branches: ["**"]
paths-ignore:
- "README.md"
- "LICENSE"
- "**/README.md"
- "**/docs/**"
- "crates/vm/levm/**" # We ran this in a separate workflow

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

env:
RUST_VERSION: 1.80.1

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4

- name: Rustup toolchain install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}

- name: Caching
uses: Swatinem/rust-cache@v2

- name: Run L2 integration test
run: |
cd crates/l2
cp .env.example .env
make test
6 changes: 2 additions & 4 deletions .github/workflows/ci_levm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: CI LEVM

on:
merge_group:
paths:
- "crates/vm/levm/**"
pull_request:
paths:
- "crates/vm/levm/**"
Expand Down Expand Up @@ -36,12 +34,12 @@ jobs:
- name: Download EF Tests
run: |
cd crates/vm/levm
make download-ef-tests
make download-evm-ef-tests
- name: Run tests
run: |
cd crates/vm/levm
make run-ef-tests
make run-evm-ef-tests
test:
name: Tests
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_skipped.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: false
steps: [run: true]

docker-build:
docker_build:
name: Build Docker image
runs-on: ubuntu-latest
if: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:

jobs:
docker-build:
docker_build:
name: Docker Build image
runs-on: ubuntu-latest
steps:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/docker_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Publish docker image to Github Packages

on:
push:
branches: ['main']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest

# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# Generates the tags and labels based on the image name. The id allows using it in the next step.
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

# Pushes to ghcr.io/ethrex
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true

Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: "Hive & Assertoor"
name: "Hive"
on:
merge_group:
paths-ignore:
- 'README.md'
- 'LICENSE'
- "**/README.md"
- "**/docs/**"
pull_request:
branches: ["**"]
paths-ignore:
Expand All @@ -23,10 +18,10 @@ env:

jobs:
build:
uses: ./.github/workflows/docker-build.yaml
uses: ./.github/workflows/docker_build.yaml

run-hive:
name: Hive - ${{ matrix.name }}
name: ${{ matrix.name }}
needs: [build]
runs-on: ubuntu-latest
strategy:
Expand All @@ -36,8 +31,8 @@ jobs:
name: "Rpc Compat tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/rpc-compat TEST_PATTERN="/eth_chainId|eth_getTransactionByBlockHashAndIndex|eth_getTransactionByBlockNumberAndIndex|eth_getCode|eth_getStorageAt|eth_call|eth_getTransactionByHash|eth_getBlockByHash|eth_getBlockByNumber|eth_createAccessList|eth_getBlockTransactionCountByNumber|eth_getBlockTransactionCountByHash|eth_getBlockReceipts|eth_getTransactionReceipt|eth_blobGasPrice|eth_blockNumber|ethGetTransactionCount|debug_getRawHeader|debug_getRawBlock|debug_getRawTransaction|debug_getRawReceipts|eth_estimateGas|eth_getBalance|eth_sendRawTransaction|eth_getProof|eth_getLogs"
- simulation: rpc-auth
name: "Rpc Auth tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/rpc-compat TEST_PATTERN="/engine-auth"
name: "Engine Auth tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="auth/engine-auth"
- simulation: discv4
name: "Devp2p discv4 tests"
run_command: make run-hive-on-latest SIMULATION=devp2p TEST_PATTERN="discv4"
Expand All @@ -46,13 +41,13 @@ jobs:
run_command: make run-hive-on-latest SIMULATION=devp2p TEST_PATTERN="/AccountRange|StorageRanges|ByteCodes|TrieNodes"
- simulation: eth
name: "Devp2p eth tests"
run_command: make run-hive SIMULATION=devp2p TEST_PATTERN="eth/status|getblockheaders|getblockbodies|transaction"
run_command: make run-hive-on-latest SIMULATION=devp2p TEST_PATTERN="eth/Status|GetBlockHeaders|SimultaneousRequests|SameRequestID|ZeroRequestID|GetBlockBodies|MaliciousHandshake|MaliciousStatus|Transaction"
- simulation: engine
name: "Engine tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="/Blob Transactions On Block 1, Cancun Genesis|Blob Transactions On Block 1, Shanghai Genesis|Blob Transaction Ordering, Single Account, Single Blob|Blob Transaction Ordering, Single Account, Dual Blob|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3 Modifies Payload ID on Different Beacon Root|NewPayloadV3 After Cancun|NewPayloadV3 Versioned Hashes|ForkchoiceUpdated Version on Payload Request"
name: "Engine Auth and EC tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="engine-(auth|exchange-capabilities)/"
- simulation: engine-cancun
name: "Cancun Engine tests"
run_command: make run-hive-on-latest SIMULATION=ethereum/engine TEST_PATTERN="cancun/Unique Payload ID|ParentHash equals BlockHash on NewPayload|Re-Execute Payload|Payload Build after New Invalid Payload|RPC|Build Payload with Invalid ChainID|Invalid PayloadAttributes, Zero timestamp, Syncing=False|Invalid PayloadAttributes, Parent timestamp, Syncing=False|Invalid PayloadAttributes, Missing BeaconRoot, Syncing=False|Suggested Fee Recipient Test|PrevRandao Opcode Transactions Test|Invalid Missing Ancestor ReOrg, StateRoot"
run_command: make run-hive-on-latest SIMULATION=ethereum/engine HIVE_EXTRA_ARGS="--sim.parallelism 4" TEST_PATTERN="engine-cancun/Blob Transactions On Block 1|Blob Transaction Ordering, Single|Blob Transaction Ordering, Multiple Accounts|Replace Blob Transactions|Parallel Blob Transactions|ForkchoiceUpdatedV3 Modifies Payload ID on Different Beacon Root|NewPayloadV3 After Cancun|NewPayloadV3 Versioned Hashes|Incorrect BlobGasUsed|Bad Hash|ParentHash equals BlockHash|RPC:|in ForkchoiceState|Unknown|Invalid PayloadAttributes|Unique|ForkchoiceUpdated Version on Payload Request|Re-Execute Payload|In-Order Consecutive Payload|Multiple New Payloads|Valid NewPayload->|NewPayload with|Payload Build after|Build Payload with|Invalid Missing Ancestor ReOrg, StateRoot|Re-Org Back to|Re-org to Previously|Safe Re-Org to Side Chain|Transaction Re-Org, Re-Org Back In|Re-Org Back into Canonical Chain, Depth=5|Suggested Fee Recipient Test|PrevRandao Opcode|Invalid NewPayload, [^R][^e]|Fork ID Genesis=0, Cancun=0|Fork ID Genesis=0, Cancun=1|Fork ID Genesis=1, Cancun=0|Fork ID Genesis=1, Cancun=2, Shanghai=2"
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
Expand All @@ -77,28 +72,3 @@ jobs:

- name: Run Hive Simulation
run: ${{ matrix.run_command }}

run-assertoor:
name: Assertoor - Stability Check
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4

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

- name: Load image
run: |
docker load --input /tmp/ethrex_image.tar
- name: Setup kurtosis testnet and run assertoor tests
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
kurtosis_version: '1.3.1'
ethereum_package_url: 'github.com/lambdaclass/ethereum-package'
ethereum_package_branch: 'ethrex-integration'
ethereum_package_args: './test_data/network_params.yaml'
28 changes: 26 additions & 2 deletions .github/workflows/hive_coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
build:
uses: ./.github/workflows/docker-build.yaml
uses: ./.github/workflows/docker_build.yaml

hive-coverage:
name: Run engine hive simulator to gather coverage information.
Expand Down Expand Up @@ -48,4 +48,28 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Generate the hive report
run: cargo run -p hive_report
id: report
run: |
cargo run -p hive_report > results.md
echo "content=$(cat results.md)" >> $GITHUB_OUTPUT
- name: Post results in summary
run: |
echo "# Hive coverage report\n\n" >> $GITHUB_STEP_SUMMARY
$(cat results.md) >> $GITHUB_STEP_SUMMARY
- name: Post results to slack
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
blocks:
- type: "header"
text:
type: "plain_text"
text: Hive coverage report
- type: "section"
text:
type: "mrkdwn"
text: ${{steps.report.outputs.content}}
File renamed without changes.
26 changes: 25 additions & 1 deletion .github/workflows/loc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,28 @@ jobs:
uses: Swatinem/rust-cache@v2

- name: Generate the loc report
run: make loc
id: loc-report
run: |
make loc
echo "content=$(cat loc_report.md)" >> $GITHUB_OUTPUT
- name: Post results in summary
run: |
echo "# `ethrex` lines of code report:\n\n" >> $GITHUB_STEP_SUMMARY
$(cat loc_report.md) >> $GITHUB_STEP_SUMMARY
- name: Post results to slack
uses: slackapi/[email protected]
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
blocks:
- type: "header"
text:
type: "plain_text"
text: ethrex lines of code report
- type: "section"
text:
type: "mrkdwn"
text: ${{steps.loc-report.outputs.content}}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ jwt.hex
tests_v3.0.0.tar.gz

.env

levm_ef_tests_report.txt

loc_report.md
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ run-hive: build-image setup-hive ## 🧪 Run Hive testing suite
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)"

run-hive-on-latest: setup-hive ## 🧪 Run Hive testing suite with the latest docker image
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)"
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)" $(HIVE_EXTRA_ARGS)

run-hive-debug: build-image setup-hive ## 🐞 Run Hive testing suite in debug mode
cd hive && ./hive --sim $(SIMULATION) --client ethrex --sim.limit "$(TEST_PATTERN)" --docker.output
Expand Down
Loading

0 comments on commit f88f0b2

Please sign in to comment.