Skip to content

Commit 3c97360

Browse files
Merge branch 'main' into alex/env_for_view_34
2 parents 6f018f4 + 3178fda commit 3c97360

File tree

129 files changed

+5650
-2069
lines changed

Some content is hidden

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

129 files changed

+5650
-2069
lines changed

.github/workflows/test-all-erigon.yml

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,16 @@ jobs:
127127
strategy:
128128
matrix:
129129
os: [ windows-2025 ]
130-
runs-on: ${{ matrix.os }}
130+
runs-on:
131+
group: "selfhosted-win"
131132

132133
steps:
133-
- name: Configure Pagefile
134-
uses: al-cheb/configure-pagefile-action@v1.5
135-
with:
136-
minimum-size: 8GB
137-
disk-root: "C:"
134+
# not needed on self-hosted runner. already configured.
135+
#- name: Configure Pagefile
136+
# uses: al-cheb/configure-pagefile-action@v1.5
137+
# with:
138+
# minimum-size: 8GB
139+
# disk-root: "C:"
138140

139141
- name: "Checkout code with submodules and large files (lfs) on ${{ matrix.os }}"
140142
if: needs.source-of-changes.outputs.changed_files != 'true'
@@ -143,22 +145,32 @@ jobs:
143145
fetch-depth: 1
144146
submodules: recursive
145147
lfs: true
148+
clean: true
146149

147150
- name: Setup Go environment on ${{ matrix.os }}
148151
if: needs.source-of-changes.outputs.changed_files != 'true'
149152
uses: actions/setup-go@v6
150153
with:
151-
go-version: '1.25'
152-
cache: true
154+
go-version: '>=1.25'
155+
cache: false
153156

154-
- name: Install make
155-
run: choco install make -y
157+
# "make" already preinstalled:
158+
#- name: Install make
159+
# run: choco install make -y
156160

157161
- name: Run all tests on ${{ matrix.os }}
158162
if: needs.source-of-changes.outputs.changed_files != 'true'
159163
shell: bash
164+
env:
165+
GOMODCACHE: C:\go-cache\mod
166+
GOCACHE: C:\go-cache\build
160167
run: make test-all
161168

169+
- name: Cleanup
170+
if: always()
171+
run: |
172+
Remove-Item -Path "$env:TEMP\*" -Recurse -Force -ErrorAction SilentlyContinue
173+
162174
- name: This ${{ matrix.os }} check does not make sense for changes within out-of-scope directories
163175
if: needs.source-of-changes.outputs.changed_files == 'true'
164176
run: echo "This check does not make sense for changes within out-of-scope directories"

.github/workflows/test-kurtosis-assertoor.yml

Lines changed: 76 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ name: Kurtosis Assertoor GitHub Action
33
env:
44
DOCKERHUB_REPOSITORY: "erigontech/erigon"
55
APP_REPO: "erigontech/erigon"
6+
# Pinned versions of third-party containers — bump here when upgrading.
7+
# These are cached via actions/cache (docker save/load) to avoid re-pulling
8+
# on every run and to eliminate Docker Hub rate-limit exposure.
9+
LIGHTHOUSE_IMAGE: "sigp/lighthouse:v7.0.1"
10+
TEKU_IMAGE: "consensys/teku:25.9.1"
11+
ASSERTOOR_IMAGE: "ethpandaops/assertoor:v0.0.17"
612

713
on:
814
push:
@@ -47,9 +53,42 @@ jobs:
4753
username: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
4854
password: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
4955

50-
- name: Docker build current branch
56+
- name: Set up Docker Buildx
57+
uses: docker/setup-buildx-action@v3
58+
59+
- name: Restore cached third-party containers
60+
id: cache-cl-images
61+
uses: actions/cache@v4
62+
with:
63+
path: /tmp/docker-cache
64+
key: docker-cl-${{ env.LIGHTHOUSE_IMAGE }}-${{ env.TEKU_IMAGE }}-${{ env.ASSERTOOR_IMAGE }}
65+
66+
- name: Load cached containers into daemon
67+
if: steps.cache-cl-images.outputs.cache-hit == 'true'
5168
run: |
52-
docker build -t test/erigon:current .
69+
docker load -i /tmp/docker-cache/lighthouse.tar
70+
docker load -i /tmp/docker-cache/teku.tar
71+
docker load -i /tmp/docker-cache/assertoor.tar
72+
73+
- name: Pull third-party containers and save to cache
74+
if: steps.cache-cl-images.outputs.cache-hit != 'true'
75+
run: |
76+
mkdir -p /tmp/docker-cache
77+
docker pull ${{ env.LIGHTHOUSE_IMAGE }}
78+
docker pull ${{ env.TEKU_IMAGE }}
79+
docker pull ${{ env.ASSERTOOR_IMAGE }}
80+
docker save ${{ env.LIGHTHOUSE_IMAGE }} -o /tmp/docker-cache/lighthouse.tar
81+
docker save ${{ env.TEKU_IMAGE }} -o /tmp/docker-cache/teku.tar
82+
docker save ${{ env.ASSERTOOR_IMAGE }} -o /tmp/docker-cache/assertoor.tar
83+
84+
- name: Build erigon Docker image (with BuildKit layer cache)
85+
uses: docker/build-push-action@v6
86+
with:
87+
context: .
88+
load: true
89+
tags: test/erigon:current
90+
cache-from: type=gha,scope=kurtosis-erigon-build
91+
cache-to: type=gha,mode=max,scope=kurtosis-erigon-build
5392

5493
- name: Run regular Kurtosis + assertoor tests
5594
uses: ethpandaops/kurtosis-assertoor-github-action@v1
@@ -91,9 +130,42 @@ jobs:
91130
username: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
92131
password: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
93132

94-
- name: Docker build current branch
133+
- name: Set up Docker Buildx
134+
uses: docker/setup-buildx-action@v3
135+
136+
- name: Restore cached third-party containers
137+
id: cache-cl-images
138+
uses: actions/cache@v4
139+
with:
140+
path: /tmp/docker-cache
141+
key: docker-cl-${{ env.LIGHTHOUSE_IMAGE }}-${{ env.TEKU_IMAGE }}-${{ env.ASSERTOOR_IMAGE }}
142+
143+
- name: Load cached containers into daemon
144+
if: steps.cache-cl-images.outputs.cache-hit == 'true'
95145
run: |
96-
docker build -t test/erigon:current .
146+
docker load -i /tmp/docker-cache/lighthouse.tar
147+
docker load -i /tmp/docker-cache/teku.tar
148+
docker load -i /tmp/docker-cache/assertoor.tar
149+
150+
- name: Pull third-party containers and save to cache
151+
if: steps.cache-cl-images.outputs.cache-hit != 'true'
152+
run: |
153+
mkdir -p /tmp/docker-cache
154+
docker pull ${{ env.LIGHTHOUSE_IMAGE }}
155+
docker pull ${{ env.TEKU_IMAGE }}
156+
docker pull ${{ env.ASSERTOOR_IMAGE }}
157+
docker save ${{ env.LIGHTHOUSE_IMAGE }} -o /tmp/docker-cache/lighthouse.tar
158+
docker save ${{ env.TEKU_IMAGE }} -o /tmp/docker-cache/teku.tar
159+
docker save ${{ env.ASSERTOOR_IMAGE }} -o /tmp/docker-cache/assertoor.tar
160+
161+
- name: Build erigon Docker image (with BuildKit layer cache)
162+
uses: docker/build-push-action@v6
163+
with:
164+
context: .
165+
load: true
166+
tags: test/erigon:current
167+
cache-from: type=gha,scope=kurtosis-erigon-build
168+
cache-to: type=gha,mode=max,scope=kurtosis-erigon-build
97169

98170
- name: Run Pectra Kurtosis + assertoor tests
99171
uses: ethpandaops/kurtosis-assertoor-github-action@v1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,6 @@ mdbx.lck
116116
*.prof
117117

118118
.claude/settings.local.json
119+
120+
# Prevent accidental commit of locally-built binaries
121+
/erigon

cl/beacon/handler/block_production.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import (
4747
"github.com/erigontech/erigon/cl/gossip"
4848
"github.com/erigontech/erigon/cl/persistence/beacon_indicies"
4949
"github.com/erigontech/erigon/cl/phase1/core/state"
50+
"github.com/erigontech/erigon/cl/phase1/network/subnets"
5051
"github.com/erigontech/erigon/cl/transition"
5152
"github.com/erigontech/erigon/cl/transition/impl/eth2"
5253
"github.com/erigontech/erigon/cl/transition/machine"
@@ -143,8 +144,13 @@ func (a *ApiHandler) GetEthV1ValidatorAttestationData(
143144
}
144145

145146
defer func() {
147+
epoch := *slot / a.beaconChainCfg.SlotsPerEpoch
148+
committeesPerSlot := a.syncedData.CommitteeCount(epoch)
149+
subnet := subnets.ComputeSubnetForAttestation(
150+
committeesPerSlot, *slot, *committeeIndex,
151+
a.beaconChainCfg.SlotsPerEpoch, 64)
146152
a.logger.Debug("Produced Attestation", "slot", *slot,
147-
"committee_index", *committeeIndex, "cached", ok, "beacon_block_root",
153+
"committee_index", *committeeIndex, "subnet", subnet, "cached", ok, "beacon_block_root",
148154
attestationData.BeaconBlockRoot, "duration", time.Since(start))
149155
}()
150156

cl/p2p/mock_services/p2p_manager_mock.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cl/phase1/network/gossip/gossip_manager.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,22 @@ func (g *GossipManager) Close() error {
101101
}
102102

103103
func (g *GossipManager) newPubsubValidator(service serviceintf.Service[any], conditions ...ConditionFunc) pubsub.ValidatorEx {
104+
var selfID peer.ID
105+
if h := g.p2p.Host(); h != nil {
106+
selfID = h.ID()
107+
}
104108
return func(ctx context.Context, pid peer.ID, msg *pubsub.Message) (result pubsub.ValidationResult) {
105109
defer func() {
106110
if r := recover(); r != nil {
107111
log.Error("[GossipManager] panic in validator, rejecting message", "err", r, "topic", msg.GetTopic())
108112
result = pubsub.ValidationReject
109113
}
110114
}()
115+
// Skip validation for self-published messages: they were already validated
116+
// by ProcessMessage before Publish was called.
117+
if selfID != "" && pid == selfID {
118+
return pubsub.ValidationAccept
119+
}
111120
curVersion := g.beaconConfig.GetCurrentStateVersion(g.ethClock.GetCurrentEpoch())
112121
// parse the topic and subnet
113122
topic := msg.GetTopic()
@@ -252,8 +261,18 @@ func (g *GossipManager) Publish(ctx context.Context, name string, data []byte) e
252261
if topicHandle == nil {
253262
return fmt.Errorf("topic not found: %s", topic)
254263
}
264+
// Log peer count for attestation topics to help diagnose propagation issues
265+
if gossip.IsTopicBeaconAttestation(name) {
266+
peerCount := len(g.p2p.Pubsub().ListPeers(topic))
267+
if peerCount == 0 {
268+
log.Warn("[Gossip] Publishing attestation with NO peers on subnet", "topic", name, "peerCount", peerCount)
269+
} else if peerCount < 3 {
270+
log.Debug("[Gossip] Publishing attestation with low peer count", "topic", name, "peerCount", peerCount)
271+
}
272+
}
255273
// Note: before publishing the message to the network, Publish() internally runs the validator function.
256-
return topicHandle.topic.Publish(ctx, compressedData, pubsub.WithReadiness(pubsub.MinTopicSize(1)))
274+
// Removed MinTopicSize(1) - don't fail if no peers on subnet, message will propagate when peers join
275+
return topicHandle.topic.Publish(ctx, compressedData)
257276
}
258277

259278
func (g *GossipManager) goCheckForkAndResubscribe(ctx context.Context) {

cl/phase1/network/services/aggregate_and_proof_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ func (a *aggregateAndProofServiceImpl) ProcessMessage(
247247
index: aggregateAndProof.SignedAggregateAndProof.Message.AggregatorIndex,
248248
}
249249
if a.seenAggreatorIndexes.Contains(seenIndex) {
250-
return nil
250+
return fmt.Errorf("%w: aggregator already seen", ErrIgnore)
251251
}
252252

253253
committee, err := headState.GetBeaconCommitee(slot, committeeIndex)

cl/phase1/network/services/attestation_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ func (s *attestationService) ProcessMessage(ctx context.Context, subnet *uint64,
263263
// mark the validator as seen
264264
epochLastTime, ok := s.validatorAttestationSeen.Get(vIndex)
265265
if ok && epochLastTime == targetEpoch {
266-
return nil
266+
return fmt.Errorf("validator already seen in target epoch %w", ErrIgnore)
267267
}
268268
s.validatorAttestationSeen.Add(vIndex, targetEpoch)
269269

0 commit comments

Comments
 (0)