Skip to content

Commit

Permalink
Pectra commits into E2 till spec tests 1.1 (#13585)
Browse files Browse the repository at this point in the history
Co-authored-by: alex.sharov <AskAlexSharov@gmail.com>
somnathb1 and AskAlexSharov authored Jan 28, 2025

Unverified

This user has not yet uploaded their public signing key.
1 parent 26d021e commit 9f27b3d
Showing 6 changed files with 99 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/kurtosis/pectra.io
Original file line number Diff line number Diff line change
@@ -3,10 +3,10 @@ participants_matrix:
- el_type: erigon
el_image: test/erigon:current
cl:
- cl_type: lighthouse
cl_image: ethpandaops/lighthouse:pawan-electra-alpha7-0dd215c
- cl_type: teku
cl_image: ethpandaops/teku:mekong
cl_image: consensys/teku:develop
- cl_type: lodestar
cl_image: ethpandaops/lodestar:devnet-5-1c2b5ed
network_params:
electra_fork_epoch: 1
min_validator_withdrawability_delay: 1
@@ -20,4 +20,4 @@ assertoor_params:
run_block_proposal_check: true
tests:
- { file: "https://raw.githubusercontent.com/ethpandaops/assertoor/refs/heads/electra-support/playbooks/pectra-dev/kurtosis/all.yaml"}

21 changes: 17 additions & 4 deletions .github/workflows/test-hive-eest.yml
Original file line number Diff line number Diff line change
@@ -14,8 +14,8 @@ jobs:
- name: Checkout Hive
uses: actions/checkout@v4
with:
repository: danceratopz/hive
ref: prague-devnet-4
repository: ethereum/hive
# ref: prague-devnet-4
path: hive
- name: Setup go env and cache
uses: actions/setup-go@v5
@@ -50,7 +50,7 @@ jobs:
echo -e "\n\n============================================================"
echo "Running test: ${1}"
echo -e "\n"
./hive --sim 'ethereum/eest/consume-engine' --client erigon 2>&1 | tee output.log || {
./hive --sim 'ethereum/eest/consume-engine' --client erigon --sim.buildarg fixtures=https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-5%40v1.1.0/fixtures_pectra-devnet-5.tar.gz --sim.buildarg branch=pectra-devnet-5 2>&1 | tee output.log || {
if [ $? -gt 0 ]; then
echo "Exitcode gt 0"
fi
@@ -71,12 +71,25 @@ jobs:
if (( tests < 4 )); then
echo "Too few tests run for suite ${1} - ${tests} tests"
echo "failed" > failed.log
exit 1
fi
if (( failed*2 > tests )); then
echo "Too many failures for suite ${1} - ${failed} failed out of ${tests}"
echo "failed" > failed.log
exit 1
fi
}
run_suite eest/consume-engine
continue-on-error: true
- name: Upload output log
uses: actions/upload-artifact@v4
with:
name: hive-workspace-log
path: hive/workspace/logs
- name: Check for failures
run: |
if grep -q "failed" hive/failed.log; then
echo "One or more tests failed."
exit 1
fi
17 changes: 16 additions & 1 deletion .github/workflows/test-hive.yml
Original file line number Diff line number Diff line change
@@ -72,10 +72,12 @@ jobs:
if (( tests < 4 )); then
echo "Too few tests run for suite ${1}-${2} - ${tests} tests"
echo "failed" > failed.log
exit 1
fi
if (( failed*2 > tests )); then
echo "Too many failures for suite ${1}-${2} - ${failed} failed out of ${tests}"
echo "failed" > failed.log
exit 1
fi
}
@@ -84,4 +86,17 @@ jobs:
run_suite engine cancun
run_suite engine api
run_suite engine auth
# run_suite rpc compat
run_suite rpc compat
continue-on-error: true
- name: Upload output log
uses: actions/upload-artifact@v4
with:
name: hive-workspace-log
path: hive/workspace/logs
continue-on-error: true
- name: Check for failures
run: |
if grep -q "failed" hive/failed.log; then
echo "One or more tests failed."
exit 1
fi
14 changes: 7 additions & 7 deletions .github/workflows/test-kurtosis-assertoor.yml
Original file line number Diff line number Diff line change
@@ -32,10 +32,10 @@ jobs:
kurtosis_extra_args: --verbosity detailed --cli-log-level trace
persistent_logs: "true"

- name: Run Pectra Kurtosis + assertoor tests
uses: ethpandaops/kurtosis-assertoor-github-action@v1
with:
enclave_name: "kurtosis-run2-${{ github.run_id }}"
ethereum_package_args: ".github/workflows/kurtosis/pectra.io"
kurtosis_extra_args: --verbosity detailed --cli-log-level trace
persistent_logs: "true"
# - name: Run Pectra Kurtosis + assertoor tests
# uses: ethpandaops/kurtosis-assertoor-github-action@v1
# with:
# enclave_name: "kurtosis-run2-${{ github.run_id }}"
# ethereum_package_args: ".github/workflows/kurtosis/pectra.io"
# kurtosis_extra_args: --verbosity detailed --cli-log-level trace
# persistent_logs: "true"
54 changes: 54 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ UNAME = $(shell uname) # Supported: Darwin, Linux
DOCKER := $(shell command -v docker 2> /dev/null)

GIT_COMMIT ?= $(shell git rev-list -1 HEAD)
SHORT_COMMIT := $(shell echo $(GIT_COMMIT) | cut -c 1-8)
GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_TAG ?= $(shell git describe --tags '--match=*.*.*' --abbrev=7 --dirty)
ERIGON_USER ?= erigon
@@ -193,6 +194,59 @@ test-hive:
act -j test-hive -s GITHUB_TOKEN=$(GITHUB_TOKEN) ; \
fi


# Define the run_suite function
define run_suite
echo -e "\n\n============================================================"; \
echo "Running test: $1-$2"; \
echo -e "\n"; \
./hive --sim ethereum/$1 --sim.limit=$2 --sim.parallelism=8 --client erigon $3 2>&1 | tee output.log; \
if [ $$? -gt 0 ]; then \
echo "Exitcode gt 0"; \
fi; \
status_line=$$(tail -2 output.log | head -1 | sed -r "s/\x1B\[[0-9;]*[a-zA-Z]//g"); \
suites=$$(echo "$$status_line" | sed -n 's/.*suites=\([0-9]*\).*/\1/p'); \
if [ -z "$$suites" ]; then \
status_line=$$(tail -1 output.log | sed -r "s/\x1B\[[0-9;]*[a-zA-Z]//g"); \
suites=$$(echo "$$status_line" | sed -n 's/.*suites=\([0-9]*\).*/\1/p'); \
fi; \
tests=$$(echo "$$status_line" | sed -n 's/.*tests=\([0-9]*\).*/\1/p'); \
failed=$$(echo "$$status_line" | sed -n 's/.*failed=\([0-9]*\).*/\1/p'); \
echo -e "\n"; \
echo "----------- Results for $1-$2 -----------"; \
echo "Tests: $$tests, Failed: $$failed"; \
echo -e "\n\n============================================================"
endef

hive-local:
docker build -t "test/erigon:$(SHORT_COMMIT)" .
rm -rf "hive-test-$(SHORT_COMMIT)" && mkdir "hive-local-$(SHORT_COMMIT)"
cd "hive-local-$(SHORT_COMMIT)" && git clone https://github.com/ethereum/hive

cd "hive-local-$(SHORT_COMMIT)/hive" && \
sed -i "s/^ARG baseimage=erigontech\/erigon$$/ARG baseimage=test\/erigon/" clients/erigon/Dockerfile && \
sed -i "s/^ARG tag=main-latest$$/ARG tag=$(SHORT_COMMIT)/" clients/erigon/Dockerfile
cd "hive-local-$(SHORT_COMMIT)/hive" && go build . 2>&1 | tee buildlogs.log
cd "hive-local-$(SHORT_COMMIT)/hive" && go build ./cmd/hiveview && ./hiveview --serve --logdir ./workspace/logs
cd "hive-local-$(SHORT_COMMIT)/hive" && $(call run_suite,engine,exchange-capabilities)
cd "hive-local-$(SHORT_COMMIT)/hive" && $(call run_suite,engine,withdrawals)
cd "hive-local-$(SHORT_COMMIT)/hive" && $(call run_suite,engine,cancun)
cd "hive-local-$(SHORT_COMMIT)/hive" && $(call run_suite,engine,api)
cd "hive-local-$(SHORT_COMMIT)/hive" && $(call run_suite,engine,auth)
cd "hive-local-$(SHORT_COMMIT)/hive" && $(call run_suite,rpc,compat)

eest-hive:
docker build -t "test/erigon:$(SHORT_COMMIT)" .
rm -rf "eest-hive-$(SHORT_COMMIT)" && mkdir "eest-hive-$(SHORT_COMMIT)"
cd "eest-hive-$(SHORT_COMMIT)" && git clone https://github.com/ethereum/hive

cd "eest-hive-$(SHORT_COMMIT)/hive" && \
sed -i "s/^ARG baseimage=erigontech\/erigon$$/ARG baseimage=test\/erigon/" clients/erigon/Dockerfile && \
sed -i "s/^ARG tag=main-latest$$/ARG tag=$(SHORT_COMMIT)/" clients/erigon/Dockerfile
cd "eest-hive-$(SHORT_COMMIT)/hive" && go build . 2>&1 | tee buildlogs.log
cd "eest-hive-$(SHORT_COMMIT)/hive" && go build ./cmd/hiveview && ./hiveview --serve --logdir ./workspace/logs
cd "eest-hive-$(SHORT_COMMIT)/hive" && $(call run_suite,eest/consume-engine,"",--sim.buildarg fixtures=https://github.com/ethereum/execution-spec-tests/releases/download/pectra-devnet-5%40v1.1.0/fixtures_pectra-devnet-5.tar.gz --sim.buildarg branch=pectra-devnet-5)

## lint-deps: install lint dependencies
lint-deps:
@cd erigon-lib && $(MAKE) lint-deps
2 changes: 1 addition & 1 deletion turbo/engineapi/engine_server.go
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ func (s *EngineServer) newPayload(ctx context.Context, req *engine_types.Executi
if len(r) <= 1 {
return nil, &rpc.InvalidParamsError{Message: fmt.Sprintf("Invalid Request at index %d", i)}
}
requests = append(requests, types.FlatRequest{Type: r[0], RequestData: r})
requests = append(requests, types.FlatRequest{Type: r[0], RequestData: r[1:]})
}
rh := requests.Hash()
header.RequestsHash = rh

0 comments on commit 9f27b3d

Please sign in to comment.