Skip to content

Commit 0509bfc

Browse files
feature/erigon-live-tracer-hook-port-based-on-main merged and conflict resolved
2 parents f324582 + 52d2bd7 commit 0509bfc

File tree

779 files changed

+25721
-10422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

779 files changed

+25721
-10422
lines changed

.github/workflows/ci-cd-main-branch-docker-images.yml

Lines changed: 81 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
name: CI-CD build and deploy docker images based on the last commit in the main branch
2-
run-name: "Commit id ${{ github.sha }}: CI-CD build and deploy docker images based on the commit id in the main branch"
1+
name: CI-CD build and deploy docker images based on the last commit in the target branch
2+
run-name: "Commit id ${{ github.sha }}: CI-CD build and deploy docker images based on the commit id in the ${{ inputs.checkout_ref == '' && github.ref_name || inputs.checkout_ref }} branch"
33

44
env:
55
APPLICATION: "erigon"
@@ -9,51 +9,81 @@ env:
99
CHECKOUT_REF: "main"
1010
DOCKERHUB_REPOSITORY: "erigontech/erigon"
1111
LABEL_DESCRIPTION: "[docker image built on a last commit id from the main branch] Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency frontier. Archive Node by default."
12-
KEEP_IMAGES: 100
1312

1413
on:
1514
push:
1615
branches:
1716
- 'main'
17+
- 'docker_pectra'
1818
paths-ignore:
1919
- '.github/**'
2020
workflow_dispatch:
21+
inputs:
22+
checkout_ref:
23+
required: false
24+
type: string
25+
default: ''
26+
description: 'The branch to checkout and build artifacts from (in case of manual run). Default is "" .'
2127

2228
jobs:
23-
define_matrix:
24-
runs-on: ubuntu-latest
25-
outputs:
26-
os: ${{ steps.os.outputs.os }}
27-
28-
steps:
29-
- name: Define os
30-
id: os
31-
run: echo 'os=ubuntu-latest' >> "$GITHUB_OUTPUT"
3229

3330
Build:
34-
needs: define_matrix
35-
runs-on: ${{ needs.define_matrix.outputs.os }}
31+
runs-on: ubuntu-latest
3632
timeout-minutes: 45
3733
outputs:
3834
docker_build_tag: ${{ steps.built_tag_export.outputs.docker_build_tag }}
3935

4036
steps:
41-
- name: Fast checkout git repository
37+
- name: Fast checkout git repository, git ref ${{ inputs.checkout_ref == '' && github.ref_name || inputs.checkout_ref }}
4238
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
4339
with:
4440
repository: ${{ env.APP_REPO }}
4541
fetch-depth: 1
46-
ref: ${{ env.CHECKOUT_REF }}
42+
ref: ${{ inputs.checkout_ref == '' && github.ref || inputs.checkout_ref }}
4743
path: 'erigon'
4844

4945
- name: Setup go env and cache
5046
uses: actions/setup-go@v5
5147
with:
52-
go-version: '>=1.22'
53-
go-version-file: 'erigon/go.mod'
48+
go-version: '>=1.23'
49+
cache: ${{ contains(fromJSON('["refs/heads/main","refs/heads/docker_pectra"]'), github.ref) }}
5450
cache-dependency-path: |
5551
erigon/go.sum
5652
53+
- name: Define variables
54+
id: def_docker_vars
55+
## Idea is:
56+
## latest image: erigontech/erigon:${tag_name}${latest_suffix}
57+
## commit id image: erigontech/erigon:${tag_name}-${short_commit_id}
58+
run: |
59+
branch_name="${{ inputs.checkout_ref == '' && github.ref_name || inputs.checkout_ref }}"
60+
case "$branch_name" in
61+
"main" )
62+
export tag_name='main';
63+
export keep_images=100;
64+
export latest_suffix='-latest'
65+
export binaries="erigon integration rpcdaemon"
66+
;;
67+
"docker_pectra" )
68+
export tag_name='docker_pectra';
69+
export keep_images=5;
70+
export latest_suffix='';
71+
export binaries="erigon caplin diag devnet downloader evm hack integration rpcdaemon rpctest sentinel sentry state txpool"
72+
;;
73+
* )
74+
# use last string after last slash '/' by default if branch contains slash:
75+
export tag_name=$(echo ${{ inputs.checkout_ref }} | sed -e 's/.*\///g' );
76+
export keep_images=0;
77+
export latest_suffix=''
78+
export binaries="erigon"
79+
;;
80+
esac
81+
echo "tag_name=${tag_name}" >> $GITHUB_OUTPUT
82+
echo "keep_images=${keep_images}" >> $GITHUB_OUTPUT
83+
echo "latest_suffix=${latest_suffix}" >> $GITHUB_OUTPUT
84+
echo "binaries=${binaries}" >> $GITHUB_OUTPUT
85+
echo "Debug ${tag_name} ${keep_images} ${latest_suffix} ${binaries}"
86+
5787
- name: Get commit id
5888
id: getCommitId
5989
run: |
@@ -75,33 +105,41 @@ jobs:
75105
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db ## v3.6.1
76106

77107
- name: Build arm64
108+
env:
109+
BINARIES: ${{ steps.def_docker_vars.outputs.binaries }}
78110
run: |
79111
docker run --platform linux/arm64 \
80112
--rm -v $(pwd)/erigon:/erigon:ro \
81113
-v $(pwd)/build-arm64:/erigon-build \
82-
-v ${HOME}/.cache/go-build/arm64:/root/.cache/go-build \
114+
-v ${HOME}/.cache/go-build:/root/.cache/go-build \
83115
-v ${HOME}/go/pkg/mod:/go/pkg/mod \
84116
-w /erigon --entrypoint /bin/sh \
85117
${{ env.BUILDER_IMAGE }} \
86-
-c "apk update; apk add make git gcc libstdc++ build-base linux-headers bash ca-certificates; git config --global --add safe.directory /erigon; make GOARCH=arm64 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm erigon integration rpcdaemon"
118+
-c "apk update; apk add make git gcc libstdc++ build-base linux-headers bash ca-certificates; git config --global --add safe.directory /erigon; make GOARCH=arm64 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm,netgo ${{ env.BINARIES }}"
87119
88120
- name: Build amd64
121+
env:
122+
BINARIES: ${{ steps.def_docker_vars.outputs.binaries }}
89123
run: |
90124
docker run --platform linux/amd64 \
91125
--rm -v $(pwd)/erigon:/erigon:ro \
92126
-v $(pwd)/build-amd64:/erigon-build \
93-
-v ${HOME}/.cache/go-build/amd64:/root/.cache/go-build \
127+
-v ${HOME}/.cache/go-build:/root/.cache/go-build \
94128
-v ${HOME}/go/pkg/mod:/go/pkg/mod \
95129
-w /erigon --entrypoint /bin/sh \
96130
${{ env.BUILDER_IMAGE }} \
97-
-c "apk update; apk add make git gcc libstdc++ build-base linux-headers bash ca-certificates; git config --global --add safe.directory /erigon; make GOARCH=amd64 GOAMD64=v2 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm erigon integration rpcdaemon"
131+
-c "apk update; apk add make git gcc libstdc++ build-base linux-headers bash ca-certificates; git config --global --add safe.directory /erigon; make GOARCH=amd64 GOAMD64=v2 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm,netgo ${{ env.BINARIES }}"
98132
99-
- name: Build and push multi-platform docker image based on the commit id ${{ steps.getCommitId.outputs.short_commit_id }} in the main branch
133+
- name: Build and push multi-platform docker image based on the commit id ${{ steps.getCommitId.outputs.short_commit_id }} in the ${{ GITHUB.BASE_REF }} branch
134+
id: built_tag_export
100135
env:
101-
BUILD_VERSION: "main-${{ steps.getCommitId.outputs.short_commit_id }}"
136+
BUILD_VERSION: "${{ steps.def_docker_vars.outputs.tag_name }}-${{ steps.getCommitId.outputs.short_commit_id }}"
137+
BUILD_VERSION_LATEST: "${{ steps.def_docker_vars.outputs.tag_name }}${{ steps.def_docker_vars.outputs.latest_suffix }}"
138+
DOCKER_PUBLISH_CONDITION: ${{ steps.def_docker_vars.outputs.keep_images > 0 && format('--tag {0}:{1} ', env.DOCKER_URL, env.BUILD_VERSION) || '' }}
102139
DOCKER_URL: ${{ env.DOCKERHUB_REPOSITORY }}
103140
DOCKERFILE_PATH: Dockerfile.release
104141
run: |
142+
echo "docker_build_tag=${{ env.BUILD_VERSION }}" >> $GITHUB_OUTPUT
105143
cp -vr build-amd64 erigon/
106144
cp -vr build-arm64 erigon/
107145
cd erigon
@@ -112,8 +150,8 @@ jobs:
112150
--sbom=true \
113151
--build-arg CI_CD_MAIN_TARGET_BASE_IMAGE=${{ env.TARGET_BASE_IMAGE }} \
114152
--build-arg CI_CD_MAIN_BUILDER_IMAGE=${{ env.BUILDER_IMAGE }} \
115-
--tag ${{ env.DOCKER_URL }}:${{ env.BUILD_VERSION }} \
116-
--tag ${{ env.DOCKER_URL }}:main-latest \
153+
${{ steps.def_docker_vars.outputs.keep_images > 0 && format('--tag {0}:{1} ', env.DOCKER_URL, env.BUILD_VERSION) || '' }} \
154+
--tag ${{ env.DOCKER_URL }}:${{ env.BUILD_VERSION_LATEST }} \
117155
--label org.opencontainers.image.created=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
118156
--label org.opencontainers.image.authors="https://github.com/erigontech/erigon/graphs/contributors" \
119157
--label org.opencontainers.image.url="https://github.com/erigontech/erigon/blob/main/Dockerfile" \
@@ -129,32 +167,39 @@ jobs:
129167
--platform linux/amd64,linux/arm64 .
130168
131169
- name: export and print docker build tag, cleanup old docker images
132-
id: built_tag_export
133170
env:
134-
BUILD_VERSION: "main-${{ steps.getCommitId.outputs.short_commit_id }}"
171+
BUILD_VERSION: "${{ steps.def_docker_vars.outputs.tag_name }}-${{ steps.getCommitId.outputs.short_commit_id }}"
172+
BUILD_VERSION_LATEST: "${{ steps.def_docker_vars.outputs.tag_name }}${{ steps.def_docker_vars.outputs.latest_suffix }}"
173+
BUILD_VERSION_CONDITION: ${{ steps.def_docker_vars.outputs.keep_images > 0 && format('{0}:{1} ',env.DOCKER_URL,env.BUILD_VERSION) || '' }}
174+
DOCKER_URL: ${{ env.DOCKERHUB_REPOSITORY }}
175+
TAG_KEY: ${{ steps.def_docker_vars.outputs.tag_name }}
176+
KEEP_IMAGES: ${{ steps.def_docker_vars.outputs.keep_images }}
135177
run: |
136-
echo "docker_build_tag=${{ env.BUILD_VERSION }}" >> $GITHUB_OUTPUT
137178
echo The following docker images have been published:
138-
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-${{ env.BUILD_VERSION }}"
139-
echo "${{ env.DOCKERHUB_REPOSITORY }}:main-latest"
179+
echo "${{ env.DOCKERHUB_REPOSITORY }}:${{ env.BUILD_VERSION_LATEST }}"
180+
echo "${{ steps.def_docker_vars.outputs.keep_images > 0 && format('{0}:{1} ',env.DOCKER_URL,env.BUILD_VERSION) || '' }} (empty, if keep_images is 0)"
140181
echo
141-
echo "Cleanup old docker images matching pattern tag ~= main-XXXXXXX"
182+
echo "Cleanup old docker images matching pattern tag ~= ${{ env.TAG_KEY }}-XXXXXXX (where XXXXXXX is a short Commit IDs)"
183+
echo "Only last $KEEP_IMAGES images will be kept."
142184
curl_cmd="curl -s -H \"Authorization: JWT ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}\" "
143185
dockerhub_url='https://hub.docker.com/v2/namespaces/erigontech/repositories/erigon'
186+
## getting all pages in a loop from dockerhub and grepping required tag from the list of tags:
144187
my_list () {
145188
# First page:
146189
next_page="$dockerhub_url/tags?page=1&page_size=100"
147190
while [ "$next_page" != "null" ]
148191
do
149-
# Print tags and push dates for tags matching "main-":
150-
$curl_cmd $next_page | jq -r '.results|.[]|.name + " " + .tag_last_pushed' | grep 'main-'
192+
# Print tags and push dates for tags matching "${{ env.TAG_KEY }}-":
193+
$curl_cmd $next_page | jq -r '.results|.[]|.name + " " + .tag_last_pushed' | grep '${{ env.TAG_KEY }}-' || true
151194
next_page=`$curl_cmd $next_page | jq '.next' | sed -e 's/^\"//' -e 's/\"$//'`
152195
done
153196
}
154-
197+
echo "DEBUG: full list of images:"
198+
my_list
199+
echo "DEBUG: end of the list."
155200
my_list | tail -n+${{ env.KEEP_IMAGES }} | while read line; do
156201
echo -n "Removing docker image/published - $line "
157-
current_image=$(echo $line | sed -e 's/^\(main-.\{7\}\) .*/\1/')
202+
current_image=$(echo $line | sed -e 's/^\(${{ env.TAG_KEY }}-.\{7\}\) .*/\1/')
158203
output_code=$(curl --write-out %{http_code} --output curl-output.log \
159204
-s -X DELETE -H "Accept: application/json" \
160205
-H "Authorization: JWT ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}" \
@@ -167,11 +212,3 @@ jobs:
167212
fi
168213
echo "Done."
169214
done
170-
171-
run-kurtosis-assertoor:
172-
needs: [define_matrix, Build]
173-
uses: erigontech/erigon/.github/workflows/test-kurtosis-assertoor.yml@main
174-
with:
175-
checkout_ref: ${{ github.sha }}
176-
os: ${{ needs.define_matrix.outputs.os }}
177-
docker_build_tag: ${{ needs.Build.outputs.docker_build_tag }}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
participants_matrix:
2+
el:
3+
- el_type: erigon
4+
el_image: test/erigon:current
5+
cl:
6+
- cl_type: lighthouse
7+
cl_image: ethpandaops/lighthouse:pawan-electra-alpha7-0dd215c
8+
- cl_type: teku
9+
cl_image: ethpandaops/teku:mekong
10+
network_params:
11+
electra_fork_epoch: 1
12+
min_validator_withdrawability_delay: 1
13+
shard_committee_period: 1
14+
churn_limit_quotient: 16
15+
additional_services:
16+
- assertoor
17+
snooper_enabled: true
18+
assertoor_params:
19+
run_stability_check: false
20+
run_block_proposal_check: true
21+
tests:
22+
- { file: "https://raw.githubusercontent.com/ethpandaops/assertoor/refs/heads/electra-support/playbooks/pectra-dev/kurtosis/all.yaml"}
23+

.github/workflows/kurtosis/config.properties renamed to .github/workflows/kurtosis/regular-assertoor.io

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
participants_matrix:
22
el:
3-
- el_type: geth
43
- el_type: erigon
5-
el_image: <<ERIGON_IMAGE_PLACEHOLDER>>
6-
- el_type: nethermind
4+
el_image: test/erigon:current
75
cl:
86
- cl_type: lighthouse
97
- cl_type: nimbus
@@ -13,10 +11,9 @@ network_params:
1311
shard_committee_period: 1
1412
additional_services:
1513
- assertoor
16-
snooper_enabled: true
1714
assertoor_params:
1815
run_stability_check: false
19-
run_block_proposal_check: false
16+
run_block_proposal_check: true
2017
tests:
2118
- https://raw.githubusercontent.com/ethpandaops/assertoor-test/master/assertoor-tests/all-opcodes-test.yaml
2219
- https://raw.githubusercontent.com/ethpandaops/assertoor-test/master/assertoor-tests/blob-transactions-test.yaml

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
if: runner.os == 'Linux'
3333
uses: golangci/golangci-lint-action@v6
3434
with:
35-
version: v1.61.0
36-
args: --help
35+
version: v1.62.2
36+
skip-cache: true
3737

3838
- name: Lint
3939
if: runner.os == 'Linux'

.github/workflows/qa-constrained-tip-tracking.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,26 @@ on:
77

88
jobs:
99
constrained-tip-tracking-test:
10-
runs-on: [self-hosted, Erigon3]
1110
timeout-minutes: 600
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
include:
15+
- chain: mainnet
16+
backend: Erigon3
17+
cgroup_name: constrained_res_32G
18+
- chain: bor-mainnet
19+
backend: Polygon
20+
cgroup_name: constrained_res_64G
21+
runs-on: [ self-hosted, "${{ matrix.backend }}" ]
1222
env:
1323
ERIGON_REFERENCE_DATA_DIR: /opt/erigon-versions/reference-version/datadir
1424
ERIGON_TESTBED_DATA_DIR: /opt/erigon-testbed/datadir
1525
ERIGON_QA_PATH: /home/qarunner/erigon-qa
1626
TRACKING_TIME_SECONDS: 14400 # 4 hours
1727
TOTAL_TIME_SECONDS: 28800 # 8 hours
18-
CHAIN: mainnet
28+
CHAIN: ${{ matrix.chain }}
29+
CGROUP_NAME: ${{ matrix.cgroup_name }}
1930

2031
steps:
2132
- name: Check out repository
@@ -44,15 +55,15 @@ jobs:
4455
set +e # Disable exit on error
4556
4657
# Run Erigon under memory constraints, wait sync and check ability to maintain sync
47-
cgexec -g memory:constrained_res_32G python3 $ERIGON_QA_PATH/test_system/qa-tests/tip-tracking/run_and_check_tip_tracking.py \
58+
cgexec -g memory:$CGROUP_NAME python3 $ERIGON_QA_PATH/test_system/qa-tests/tip-tracking/run_and_check_tip_tracking.py \
4859
${{ github.workspace }}/build/bin $ERIGON_TESTBED_DATA_DIR $TRACKING_TIME_SECONDS $TOTAL_TIME_SECONDS Erigon3 $CHAIN standard_node statistics
4960
5061
# Capture monitoring script exit status
5162
test_exit_status=$?
5263

5364
# Save the subsection reached status
54-
echo "::set-output name=test_executed::true"
55-
65+
echo "test_executed=true" >> $GITHUB_OUTPUT
66+
5667
# Clean up Erigon process if it's still running
5768
if kill -0 $ERIGON_PID 2> /dev/null; then
5869
echo "Terminating Erigon"
@@ -94,14 +105,14 @@ jobs:
94105
if: steps.test_step.outputs.test_executed == 'true'
95106
uses: actions/upload-artifact@v4
96107
with:
97-
name: test-results
108+
name: test-results-${{ env.CHAIN }}
98109
path: ${{ github.workspace }}/result-${{ env.CHAIN }}.json
99110

100111
- name: Upload Erigon full log
101112
if: steps.test_step.outputs.test_executed == 'true'
102113
uses: actions/upload-artifact@v4
103114
with:
104-
name: erigon-log
115+
name: erigon-log-${{ env.CHAIN }}
105116
path: |
106117
${{ env.ERIGON_TESTBED_DATA_DIR }}/logs/erigon.log
107118
${{ env.ERIGON_TESTBED_DATA_DIR }}/proc_stat.log

.github/workflows/qa-rpc-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Checkout RPC Tests Repository & Install Requirements
3333
run: |
3434
rm -rf ${{ runner.workspace }}/rpc-tests
35-
git -c advice.detachedHead=false clone --depth 1 --branch v1.18.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
35+
git -c advice.detachedHead=false clone --depth 1 --branch v1.22.0 https://github.com/erigontech/rpc-tests ${{runner.workspace}}/rpc-tests
3636
cd ${{ runner.workspace }}/rpc-tests
3737
pip3 install -r requirements.txt
3838

0 commit comments

Comments
 (0)