Skip to content

Commit

Permalink
Merge branch 'main' into hex-patricia-reader-proof
Browse files Browse the repository at this point in the history
  • Loading branch information
shotasilagadzetaal committed Feb 2, 2025
2 parents 15257a0 + f2efd04 commit 75221e2
Show file tree
Hide file tree
Showing 269 changed files with 11,733 additions and 3,402 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-cd-main-branch-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ run-name: "Commit id ${{ github.sha }}: CI-CD build and deploy docker images bas

env:
APPLICATION: "erigon"
BUILDER_IMAGE: "golang:1.23.3-alpine3.20"
TARGET_BASE_IMAGE: "alpine:3.20.3"
BUILDER_IMAGE: "golang:1.23-alpine"
TARGET_BASE_IMAGE: "alpine:3.21"
APP_REPO: "erigontech/erigon"
CHECKOUT_REF: "main"
DOCKERHUB_REPOSITORY: "erigontech/erigon"
Expand All @@ -28,7 +28,7 @@ on:
jobs:

Build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04 ## revert it to "ubuntu-latest" once https://github.com/actions/runner-images/issues/11471 fixed
timeout-minutes: 45
outputs:
docker_build_tag: ${{ steps.built_tag_export.outputs.docker_build_tag }}
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/kurtosis/pectra.io
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -19,5 +19,4 @@ assertoor_params:
run_stability_check: false
run_block_proposal_check: true
tests:
- { file: "https://raw.githubusercontent.com/ethpandaops/assertoor/refs/heads/electra-support/playbooks/pectra-dev/kurtosis/all.yaml"}

- { file: "https://raw.githubusercontent.com/ethpandaops/assertoor/refs/heads/electra-support/playbooks/pectra-dev/kurtosis/all.yaml"}
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v6
with:
version: v1.62.2
version: v1.63.4
skip-cache: true

- name: Lint
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/qa-constrained-tip-tracking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ jobs:
- chain: mainnet
backend: Erigon3
cgroup_name: constrained_res_32G
prune_mode: archive_node
- chain: bor-mainnet
backend: Polygon
cgroup_name: constrained_res_64G
prune_mode: full_node
runs-on: [ self-hosted, "${{ matrix.backend }}" ]
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version/datadir
Expand All @@ -27,6 +29,7 @@ jobs:
TOTAL_TIME_SECONDS: 28800 # 8 hours
CHAIN: ${{ matrix.chain }}
CGROUP_NAME: ${{ matrix.cgroup_name }}
PRUNE_MODE: ${{ matrix.prune_mode }}

steps:
- name: Check out repository
Expand Down Expand Up @@ -56,7 +59,7 @@ jobs:
# Run Erigon under memory constraints, wait sync and check ability to maintain sync
cgexec -g memory:$CGROUP_NAME python3 $ERIGON_QA_PATH/test_system/qa-tests/tip-tracking/run_and_check_tip_tracking.py \
${{ github.workspace }}/build/bin $ERIGON_TESTBED_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN standard_node statistics
${{ github.workspace }}/build/bin $ERIGON_TESTBED_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN $PRUNE_MODE statistics
# Capture monitoring script exit status
test_exit_status=$?
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qa-rpc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Checkout RPC Tests Repository & Install Requirements
run: |
rm -rf ${{ runner.workspace }}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.27.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1_38_0_remove_total_difficulty https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{ runner.workspace }}/rpc-tests
pip3 install -r requirements.txt
Expand Down
238 changes: 238 additions & 0 deletions .github/workflows/qa-rpc-performance-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,238 @@
name: QA - RPC Performance Tests

on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Run on Sunday at 00:00 AM UTC

jobs:
performance-test-suite:
strategy:
matrix:
include:
- chain: mainnet
backend: Erigon3
#- chain: bor-mainnet
# backend: Polygon
runs-on: [ self-hosted, "${{ matrix.backend }}" ]
env:
ERIGON_DIR: /opt/erigon-versions/reference-version
ERIGON_DATA_DIR: /opt/erigon-versions/reference-version/datadir
RPC_PAST_TEST_DIR: /opt/rpc-past-tests
ERIGON_QA_PATH: /opt/erigon-qa
CHAIN: ${{ matrix.chain }}

steps:
- name: Checkout Silkworm repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: "0"

- name: Checkout RPC Tests Repository & Install Requirements
run: |
rm -rf ${{runner.workspace}}/rpc-tests
git -c advice.detachedHead=false clone --depth 1 --branch v1.27.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
cd ${{runner.workspace}}/rpc-tests
pip3 install -r requirements.txt --break-system-packages
- name: Clean Erigon Build Directory
run: |
make clean
- name: Build Erigon RPCDaemon
run: |
make rpcdaemon
working-directory: ${{ github.workspace }}

- name: Pause the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
- name: Run RpcDaemon
working-directory: ${{ github.workspace }}/build/bin
run: |
echo "RpcDaemon starting..."
./rpcdaemon --datadir $ERIGON_REFERENCE_DATA_DIR --http.api admin,debug,eth,parity,erigon,trace,web3,txpool,ots,net --ws --verbosity 1 > erigon.log 2>&1 &
RPC_DAEMON_PID=$!
echo "RPC_DAEMON_PID=$RPC_DAEMON_PID" >> $GITHUB_ENV
echo "RpcDaemon started"
- name: Wait for port 8545 to be opened
run: |
for i in {1..30}; do
if nc -z localhost 8545; then
echo "Port 8545 is open"
break
fi
echo "Waiting for port 8545 to open..."
sleep 10
done
if ! nc -z localhost 8545; then
echo "Port 8545 did not open in time"
exit 1
fi
- name: Run RPC Performance Tests
id: test_step
run: |
set +e # Disable exit on error
failed_test=0
commit=$(git -C ${{runner.workspace}}/silkworm rev-parse --short HEAD) # use ${{ github.sha }} or GITHUB_SHA
past_test_dir=$RPC_PAST_TEST_DIR/mainnet_$(date +%Y%m%d_%H%M%S)_perf_$commit
echo "past_test_dir=$past_test_dir" >> $GITHUB_ENV
# Prepare historical test results directory
mkdir -p $past_test_dir
rm -rf $RPC_PAST_TEST_DIR/mainnet_bin # we want only the latest binary files
mkdir -p $RPC_PAST_TEST_DIR/mainnet_bin
run_perf () {
network=$1
method=$2
pattern=$3
sequence=$4
# clean temporary area
cd ${{runner.workspace}}/rpc-tests/perf
rm -rf ./reports/
python3 ./run_perf_tests.py --blockchain "$network" \
--test-type "$method" \
--pattern-file pattern/"$network"/"$pattern".tar \
--test-sequence "$sequence" \
--repetitions 5 \
--erigon-dir $ERIGON_DATA_DIR \
--test-mode 2 \
--test-report \
--json-report ./reports/mainnet/result.json \
--testing-daemon erigon
# Capture test runner script exit status
perf_exit_status=$?
# Preserve test results
mv ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/result.json ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/erigon-$method-result.json
# Detect the pre-built db version
db_version=$(python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/prod_info.py $ERIGON_DIR/production.ini production erigon_repo_commit)
# Check test runner script exit status
if [ $perf_exit_status -eq 0 ]; then
# save all vegeta binary report
echo "Save current vegeta binary files"
cp -r ${{runner.workspace}}/rpc-tests/perf/reports/bin $RPC_PAST_TEST_DIR/mainnet_bin
echo "Save test result on DB"
cd ${{runner.workspace}}/erigon
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py \
--repo erigon \
--branch ${{ github.ref_name }} \
--commit $(git rev-parse HEAD) \
--test_name rpc-performance-test-erigon-$method \
--chain mainnet \
--runner ${{ runner.name }} \
--db_version $db_version \
--outcome success \
--result_file ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/erigon-$method-result.json
if [ $? -ne 0 ]; then
failed_test=1
echo "Failure saving test results on DB"
fi
echo "Execute Latency Percentile HDR Analysis"
cd ${{runner.workspace}}/rpc-tests/perf/reports/mainnet/
python3 $ERIGON_QA_PATH/test_system/qa-tests/rpc-tests/perf_hdr_analysis.py \
--test_name erigon-$method \
--input_file ./result.json \
--output_file ./erigon-$method-latency_hdr_analysis.pdf
else
failed_test=1
cd ${{runner.workspace}}/erigon
python3 $ERIGON_QA_PATH/test_system/qa-tests/uploads/upload_test_results.py \
--repo erigon \
--branch ${{ github.ref_name }} \
--commit $(git rev-parse HEAD) \
--test_name rpc-performance-test-erigon-$method \
--chain mainnet \
--runner ${{ runner.name }} \
--db_version $db_version \
--outcome failure
fi
# Save test results to a directory with timestamp and commit hash
cp -r ${{runner.workspace}}/rpc-tests/perf/reports/mainnet $past_test_dir
}
# Launch the RPC performance test runner
failed_test=0
run_perf mainnet eth_call stress_test_eth_call_001_14M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getLogs stress_test_eth_getLogs_15M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getBalance stress_test_eth_getBalance_15M 1:1,100:30,1000:20,10000:20,20000:20
run_perf mainnet eth_getBlockByHash stress_test_eth_getBlockByHash_14M 1:1,100:30,1000:20,10000:20
run_perf mainnet eth_getBlockByNumber stress_test_eth_getBlockByNumber_13M 1:1,100:30,1000:20,5000:20
run_perf mainnet eth_getTransactionByHash stress_test_eth_getTransactionByHash_13M 1:1,100:30,1000:20,10000:20
run_perf mainnet eth_getTransactionReceipt stress_test_eth_getTransactionReceipt_14M 1:1,100:30,1000:20,5000:20,10000:20,20000:20
run_perf mainnet eth_createAccessList stress_test_eth_createAccessList_16M 1:1,100:30,1000:20,10000:20,20000:20
# Save the subsection reached status
echo "::set-output name=test_executed::true"
if [ $failed_test -eq 0 ]; then
echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
echo "Tests completed successfully"
else
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
echo "Error detected during tests"
fi
- name: Stop Erigon RpcDaemon
working-directory: ${{ github.workspace }}/build/bin
run: |
# Clean up rpcdaemon process if it's still running
if kill -0 $RPC_DAEMON_PID 2> /dev/null; then
echo "RpcDaemon stopping..."
kill $RPC_DAEMON_PID
echo "RpcDaemon stopped"
else
echo "RpcDaemon has already terminated"
fi
- name: Resume the Erigon instance dedicated to db maintenance
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/resume_production.py || true
#- name: Run change point analysis
# if: steps.test_step.outputs.TEST_RESULT == 'success'
# working-directory: ${{runner.workspace}}/rpc-tests/perf/reports/mainnet
# run: |
# set +e # Disable exit on error
# open_change_points=0
# python3 $ERIGON_QA_PATH/test_system/qa-tests/change-points/change_point_analysis.py
# open_change_points=$?
# cp change_point_analysis.pdf $past_test_dir
# if [ $open_change_points -ne 0 ]; then
# echo "Change point analysis found points that need to be investigated"
# #echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT" -- enable in the future
# fi

- name: Upload test results
if: steps.test_step.outputs.test_executed == 'true'
uses: actions/upload-artifact@v4
with:
name: test-results
path: ${{ env.past_test_dir }}

- name: Action for Success
if: steps.test_step.outputs.TEST_RESULT == 'success'
run: echo "::notice::Tests completed successfully"

- name: Action for Not Success
if: steps.test_step.outputs.TEST_RESULT != 'success'
run: |
echo "::error::Error detected during tests"
exit 1
6 changes: 3 additions & 3 deletions .github/workflows/qa-tip-tracking-polygon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ jobs:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version/datadir
ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
ERIGON_QA_PATH: /home/qarunner/erigon-qa
TRACKING_TIME_SECONDS: 14400 # 4 hours
TOTAL_TIME_SECONDS: 28800 # 8 hours
TRACKING_TIME_SECONDS: 21600 # 6 hours
TOTAL_TIME_SECONDS: 43200 # 12 hours
CHAIN: bor-mainnet

steps:
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
# 2. Allow time for the Erigon to achieve synchronization
# 3. Begin timing the duration that Erigon maintains synchronization
python3 $ERIGON_QA_PATH/test_system/qa-tests/tip-tracking/run_and_check_tip_tracking.py \
${{ github.workspace }}/build/bin $ERIGON_TESTBED_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN
${{ github.workspace }}/build/bin $ERIGON_TESTBED_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN full_node
# Capture monitoring script exit status
test_exit_status=$?
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/qa-tip-tracking.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
timeout-minutes: 600
env:
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version/datadir
ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
ERIGON_QA_PATH: /home/qarunner/erigon-qa
TRACKING_TIME_SECONDS: 14400 # 4 hours
TOTAL_TIME_SECONDS: 28800 # 8 hours
Expand All @@ -34,9 +33,9 @@ jobs:
run: |
python3 $ERIGON_QA_PATH/test_system/db-producer/pause_production.py || true
- name: Restore Erigon Testbed Data Directory
- name: Clean Erigon Chaindata Directory
run: |
rsync -a --delete $ERIGON_REFERENCE_DATA_DIR/ $ERIGON_TESTBED_DATA_DIR/
rm -rf $ERIGON_REFERENCE_DATA_DIR/chaindata
- name: Run Erigon, wait sync and check ability to maintain sync
id: test_step
Expand All @@ -47,7 +46,7 @@ jobs:
# 2. Allow time for the Erigon to achieve synchronization
# 3. Begin timing the duration that Erigon maintains synchronization
python3 $ERIGON_QA_PATH/test_system/qa-tests/tip-tracking/run_and_check_tip_tracking.py \
${{ github.workspace }}/build/bin $ERIGON_TESTBED_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN
${{ github.workspace }}/build/bin $ERIGON_REFERENCE_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN
# Capture monitoring script exit status
test_exit_status=$?
Expand Down Expand Up @@ -104,7 +103,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: erigon-log
path: ${{ env.ERIGON_TESTBED_DATA_DIR }}/logs/erigon.log
path: ${{ env.ERIGON_REFERENCE_DATA_DIR }}/logs/erigon.log

- name: Upload metric plots
if: steps.test_step.outputs.test_executed == 'true'
Expand All @@ -113,10 +112,10 @@ jobs:
name: metric-plots
path: ${{ github.workspace }}/metrics-${{ env.CHAIN }}-plots*

- name: Delete Erigon Testbed Data Directory
- name: Clean Erigon Chaindata Directory
if: always()
run: |
rm -rf $ERIGON_TESTBED_DATA_DIR
rm -rf $ERIGON_REFERENCE_DATA_DIR/chaindata
- name: Resume the Erigon instance dedicated to db maintenance
run: |
Expand Down
Loading

0 comments on commit 75221e2

Please sign in to comment.