Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
222 commits
Select commit Hold shift + click to select a range
cb74da9
Upgrade go version to 1.23
stakepeter Apr 1, 2026
433a349
Add Claude.md
stakepeter Apr 1, 2026
71d5f89
Refactor Metrics
stakepeter Apr 2, 2026
e0743c0
Update CLAUDE.md
stakepeter Apr 2, 2026
61f2beb
Speed up epoch processing with attestors api
stakepeter Apr 2, 2026
06ebd37
Update go to 1.25
stakepeter Apr 2, 2026
350403a
Remove dead code and update CLAUDE.md
stakepeter Apr 2, 2026
8575d4b
Update go.mod
stakepeter Apr 2, 2026
6c572fd
Emit every skipped epoch in SubscribeToEpochs
stakepeter May 12, 2026
a185fea
Bump Docker base images and Go dependencies
stakepeter May 12, 2026
01b06b8
Dedup attestation metrics across epoch iterations
stakepeter May 12, 2026
848d7ff
Bump golangci-lint to v2 and clear the new findings
stakepeter May 12, 2026
eb0ce38
Fix Caplin compatibility in block parsing and attestation tracking
stakepeter May 12, 2026
3a0c74b
Fix lookahead/dedup masking false missed attestations
stakepeter May 12, 2026
3d7127f
Skip distance metric for attestations included before the scan window
stakepeter May 12, 2026
40c5b61
Add beacon API request metrics
stakepeter May 12, 2026
c71cc5c
Expand and restyle test-env Grafana dashboard
stakepeter May 12, 2026
28881d4
Use templated beacon API path as endpoint metric label
stakepeter May 12, 2026
780b087
Tighten validator filter and 404 handling in BeaconChain
stakepeter May 12, 2026
267f235
Use per-relay timeout for MEV bid traces
stakepeter May 12, 2026
3845e65
Sweep audit fixes across the per-epoch monitor loop
stakepeter May 12, 2026
a2a84ff
Correct stale claims and add gotchas in CLAUDE.md
stakepeter May 12, 2026
0503bbb
Fix CI build matrix, run tests in CI, and prune dead CLI surface
stakepeter May 12, 2026
b427df2
Split per-epoch monitor loop into per-concern components
stakepeter May 12, 2026
f8cb590
Fix nil-deref crash in reportToSlack on transport failure
stakepeter May 12, 2026
f259b6a
Close pubkey files immediately in LoadKeys
stakepeter May 12, 2026
f71511c
Retry transient block fetches in ListEpochBlocks
stakepeter May 12, 2026
fa0d6c7
Sync + close the tmpfile before renaming in SaveCache
stakepeter May 12, 2026
5ffa8d4
Guard processAttestations against attestation-distance underflow
stakepeter May 12, 2026
9e4c6bd
Bound Slack POST with an explicit 5s client timeout
stakepeter May 12, 2026
60ef2e4
Cover MEV bid handling and guard exptBackoff jitter
stakepeter May 12, 2026
96f0299
Apply gofmt to pkg/
stakepeter May 12, 2026
3cb7df4
Surface relay HTTP status in requestBidTracesPage errors
stakepeter May 12, 2026
c8d8ccc
Prevent uint64 slot underflow in requestRelayEpochBidTraces pagination
stakepeter May 12, 2026
ae28a5d
Make SubscribeToEpochs channel sends ctx-aware
stakepeter May 12, 2026
8528d44
Close epochsChan via defer so the orchestrator always unblocks
stakepeter May 12, 2026
73780a7
Return a clean cache from LoadCache on Unmarshal failure
stakepeter May 12, 2026
2285561
Log slot + expected/actual on CheckProposal proposer mismatch
stakepeter May 12, 2026
10d5930
Cancel ctx when orchestrator exits to drain SSE goroutine
stakepeter May 12, 2026
8d115e2
Log real registration errors in NewMonitorMetrics
stakepeter May 12, 2026
b0e85f1
Re-init Validators after Unmarshal so null cache doesn't panic SaveCache
stakepeter May 12, 2026
7253583
Fix defer-order deadlock on metrics-server shutdown
stakepeter May 12, 2026
837a095
Defend isBlockEmpty/CheckProposal against nil ExecutionPayload
stakepeter May 12, 2026
2f80cb2
Match relay bid pubkey case-insensitively in ListBestBids
stakepeter May 12, 2026
78484e8
Compare relay BlockHash case-insensitively in CheckProposal
stakepeter May 12, 2026
8321727
Remove dead ListAttesterDuties function
stakepeter May 12, 2026
acee33c
Stop the backoff timer when ctx wins the select
stakepeter May 12, 2026
0284ebf
Watch relayCtx during MEV retry backoff
stakepeter May 12, 2026
e26544e
Skip attestations with nil Data instead of crashing
stakepeter May 12, 2026
d9b9f7a
Defend nil block.Message / Body in attestation+proposal paths
stakepeter May 12, 2026
a11817f
Skip nil entries in the Attestations slice
stakepeter May 12, 2026
bfb93eb
Skip nil duty entries in attester-duty loops
stakepeter May 12, 2026
8974ea2
Log Slack non-2xx responses in reportToSlack
stakepeter May 12, 2026
eb3447e
Guard SSE head-event type assertion with the two-value form
stakepeter May 12, 2026
4c20328
Guard nil event pointer in SSE head handler
stakepeter May 12, 2026
f4526ac
Co-locate SaveCache tmpfile with the destination so Rename can't EXDEV
stakepeter May 12, 2026
70f1a8c
Defend isBlockEmpty against a nil body
stakepeter May 12, 2026
4380572
Make SaveCache(nil) a silent no-op
stakepeter May 12, 2026
ce2e730
Emit Measure elapsed-time log even when handler panics
stakepeter May 12, 2026
26500b6
Filter empty entries in LoadMEVRelays output
stakepeter May 12, 2026
8c8a0e6
Panic with a clear message on nil Finality response
stakepeter May 12, 2026
51364bb
Cap requestRelayEpochBidTraces pagination at 64 pages
stakepeter May 12, 2026
e4ab58c
Skip SaveCache tmpfile Remove after a successful Rename
stakepeter May 12, 2026
b03be0b
Render unknown pubkeys as "unknown" in Report messages
stakepeter May 12, 2026
0b595d0
Detect ctx cancellation in BuildEpochContext as clean shutdown
stakepeter May 12, 2026
c180874
Detect ctx cancellation in SubscribeToEpochs Events as clean shutdown
stakepeter May 12, 2026
1605211
Detect ctx cancellation during startup Finality fetch
stakepeter May 12, 2026
4f52d7e
Cap LoadCache read at 64 MiB
stakepeter May 12, 2026
779517a
fsync parent directory after Rename for crash-durable swap
stakepeter May 12, 2026
6678107
Cap MEV relay response body at 4 MiB
stakepeter May 12, 2026
24c0278
Explicit two-value type assertions for beacon Service interfaces
stakepeter May 12, 2026
aab06ee
Defend CheckProposal against nil block pointer
stakepeter May 12, 2026
c859cca
Extend processAttestations nil guard to cover nil block
stakepeter May 12, 2026
e083368
Short-circuit orchestrator on cancelled ctx before per-epoch work
stakepeter May 12, 2026
7f8d75b
Test orchestrator early ctx-err bail short-circuits per-epoch work
stakepeter May 12, 2026
f5011b9
Pin LoadCache(null) behavior with a regression test
stakepeter May 12, 2026
089046a
Strengthen TopLevelNull test: verify merged entry persists
stakepeter May 12, 2026
c521c57
Add pubkey to nil-ExecutionPayload error log
stakepeter May 12, 2026
d22b2c8
Document cacheFilePath contract and intended override path
stakepeter May 12, 2026
1a40d75
Normalise nil-ExecutionPayload log format to match other Reports
stakepeter May 12, 2026
8e66301
Lazy-init CommitteeInfo.Validators in BuildCommitteeLookup
stakepeter May 12, 2026
086dab6
Upgrade SaveCache MarshalIndent error log from Debug to Error
stakepeter May 12, 2026
d17f947
Surface dir.Sync errors in SaveCache rather than discarding
stakepeter May 12, 2026
2e89a06
Update CheckProposal log msg to cover all three nil cases
stakepeter May 12, 2026
86663d6
Add epoch field to proposer-mismatch error log
stakepeter May 12, 2026
576f657
Update CheckProposal doc to list both false-return cases
stakepeter May 12, 2026
c1b83c5
Document BuildCommitteeLookup nil-duty skip
stakepeter May 12, 2026
6d48b08
Document processAttestations defensive nil handling
stakepeter May 12, 2026
f07efa7
Document Measure panic-safety contract
stakepeter May 12, 2026
0edbc95
Document Must contract and ctx-cancel exception
stakepeter May 12, 2026
35340f6
Document Set nil-receiver contract
stakepeter May 12, 2026
dabfe4a
Document SaveCache atomicity, merge, and concurrency contract
stakepeter May 12, 2026
3ce43c4
Document LoadCache return contract and degraded paths
stakepeter May 12, 2026
3c9d780
Document LoadKeys and LoadMEVRelays behaviour
stakepeter May 12, 2026
c3b59a7
Document FinalizeMissedProposals iteration order and Slack semantics
stakepeter May 12, 2026
d147248
Document Report and Info contracts
stakepeter May 12, 2026
bb7054d
Document LocalCache and CachedIndex types
stakepeter May 12, 2026
a3b991e
Document BidTrace schema, JSON-tag rationale, and case-fold contract
stakepeter May 12, 2026
75f7a71
Document ListBestBids: partial-results contract and case-fold compare
stakepeter May 12, 2026
5dd364d
Document each Set method's nil-receiver behaviour
stakepeter May 12, 2026
9ffbe75
Document reportToSlack failure-mode contract
stakepeter May 12, 2026
608806c
Document mev.go internal helpers
stakepeter May 12, 2026
3edccab
Document ListEpochBlocks lookahead and persistent-error policy
stakepeter May 12, 2026
a7256d4
Add package-level doc.go for pkg
stakepeter May 12, 2026
d014af9
Expand NewMonitorMetrics doc with registration-error semantics
stakepeter May 12, 2026
dfdf51e
Use filepath instead of path in cache.go for OS portability
stakepeter May 12, 2026
c941fae
Document Slack serialisation limit in FinalizeMissedAttestations
stakepeter May 12, 2026
91719b5
Replace custom itoa with strconv.Itoa in monitoring_test.go
stakepeter May 12, 2026
ea2b4d2
Update CLAUDE.md cache gotcha: TTL now 30 minutes + durability notes
stakepeter May 12, 2026
ecd60cd
Update CLAUDE.md logging convention to reflect structured-field usage
stakepeter May 12, 2026
c9bdba5
Update CLAUDE.md error-handling note: ctx-cancel handled cleanly
stakepeter May 12, 2026
832e053
Wrap relayCtx error in requestEpochBidTraces timeout return
stakepeter May 12, 2026
462e580
Distinguish ENOENT from real errors in LoadCache open failure log
stakepeter May 12, 2026
328f979
Upgrade LoadCache io.ReadAll failure to Warn
stakepeter May 12, 2026
86a2e5e
Document orchestrator shutdown semantics and CheckProposal false cases
stakepeter May 12, 2026
8f46544
Expand SubscribeToEpochs doc with modes, shutdown, and defensive guards
stakepeter May 12, 2026
9c66ed3
Expand ResolveValidatorKeys doc with caching and chunking details
stakepeter May 12, 2026
849c3da
Add nil-ExecutionPayload branch to CheckProposal write-list doc
stakepeter May 12, 2026
db2fee6
Include epoch in FinalizeMissedProposals Report message
stakepeter May 12, 2026
b360bf1
Document the new epoch parameter on FinalizeMissedProposals
stakepeter May 12, 2026
f0fcbf3
Document writeFile test helper
stakepeter May 12, 2026
b25d8f5
Document isBlockEmpty nil-body branch
stakepeter May 12, 2026
8176578
Strengthen TestCheckProposal_NilBlock with metric assertions
stakepeter May 12, 2026
217172c
Per-subtest metrics + zero-counter assertions in NilMessageOrBody test
stakepeter May 12, 2026
5dbcedb
Add zero-counter assertions to TestProcessAttestationsSkipsNilMessage…
stakepeter May 12, 2026
3d04b80
Add zero-counter assertions to TestProcessAttestationsSkipsNilAttesta…
stakepeter May 12, 2026
f3fb513
Include epoch in CheckProposal vanilla + nil-payload logs
stakepeter May 12, 2026
4fadb6c
Use slot's epoch (not iteration epoch) in FinalizeMissedAttestations …
stakepeter May 12, 2026
9998084
Use attestedSlot's epoch in processAttestations delayed/success Reports
stakepeter May 12, 2026
6eae0c6
Correct ETH2_epoch metric description: not justified, just-ended
stakepeter May 12, 2026
7505d2e
Correct ETH2_epoch Help string to match actual semantics
stakepeter May 12, 2026
841b0a4
Correct empty-block Help strings: covers more than no-transactions
stakepeter May 12, 2026
e60a276
Correct CLAUDE.md empty-block metric description
stakepeter May 12, 2026
6567179
Correct MissedSlotsInEpoch Help: latest processed, not "current"
stakepeter May 12, 2026
70d7a0d
Correct MissedSlotsInEpoch description in CLAUDE.md
stakepeter May 12, 2026
47d70cb
Clarify attestation-distance numbering convention in metric Help
stakepeter May 12, 2026
3bac4ff
Document attestation-distance numbering convention in CLAUDE.md
stakepeter May 12, 2026
75eafdb
Clarify TotalDelayedAttestationsOverTolerance distance threshold
stakepeter May 12, 2026
8755990
Hoist attestedSlotEpoch out of the per-validator loop
stakepeter May 12, 2026
131706f
Reuse hoisted attestedSlotEpoch in cross-epoch attestation check
stakepeter May 12, 2026
af30902
Hoist blockSlotEpoch out of the per-attestation loop
stakepeter May 12, 2026
7b54c4b
Switch processAttestations error logs to structured fields
stakepeter May 12, 2026
61413db
Structure mev.go log calls with Err()/Str() fields
stakepeter May 12, 2026
cd8cd15
Structure the requestBidTracesPage debug call log
stakepeter May 12, 2026
014067e
Structure monitoring.go epoch/slot logs across remaining Msgf calls
stakepeter May 12, 2026
c8e2c4c
Structure LoadCache trace log with Str("path") field
stakepeter May 12, 2026
aacfc46
Structure BuildEpochContext validator-resolved Debug log
stakepeter May 12, 2026
6d04dfa
Structure MEV-boosts-count Debug log
stakepeter May 12, 2026
30e4bd7
Structure CheckProposal missing-bid-trace Error log
stakepeter May 12, 2026
00dcf08
Structure CheckProposal nil-payload + vanilla-block Error logs
stakepeter May 12, 2026
9d7a424
Structure reporting.go Slack-failure log calls
stakepeter May 12, 2026
495da19
Structure NewMonitorMetrics register-failure log
stakepeter May 12, 2026
a7cdd8d
Structure the proposer-duties Trace log
stakepeter May 12, 2026
39f9965
Structure FinalizeMissedAttestations unfulfilled-duties Debug log
stakepeter May 12, 2026
4e4c291
Thread ctx through MEV relay HTTP requests
stakepeter May 12, 2026
161934c
Guard ListProposerDuties against nil duty entries
stakepeter May 12, 2026
d779ef8
Fix off-by-one re-emit of persisted epoch on restart
stakepeter May 12, 2026
9585f53
Stop LoadKeys aliasing opts.Monitor.Pubkeys backing array
stakepeter May 12, 2026
0ac57fc
Block SubscribeToEpochs until ctx cancel after async Events call
stakepeter May 13, 2026
7f474f5
Add CI coverage job and Makefile lint/test targets
stakepeter May 13, 2026
54ee65b
Add beaconchain e2e tests for all six BeaconChain methods
stakepeter May 13, 2026
b6e0c37
Sync CLAUDE.md with current Makefile/CI and bump .tool-versions
stakepeter May 13, 2026
3dfea54
Restructure repo to golang-standards/project-layout
stakepeter May 13, 2026
e1abbe0
Update CLAUDE.md for the new internal/ layout
stakepeter May 13, 2026
1ebe34a
Add live-beacon fixture tests for metrics.go detection paths
stakepeter May 13, 2026
3aedc02
Add fixture-acquisition infrastructure for offline unit tests
stakepeter May 13, 2026
248675d
Document the test-fixture pattern in CLAUDE.md
stakepeter May 13, 2026
06d77a4
Phase A: Capture MEV bid traces in fixturegen
stakepeter May 13, 2026
690df13
Phase B: Delete trivial unit-test files ahead of integration tests
stakepeter May 13, 2026
d00264d
Phase C.1: Replace epoch_context_test with integration tests
stakepeter May 13, 2026
083dbed
Phase C.2: Replace mev_test with integration tests
stakepeter May 13, 2026
a24c0ab
Phase C.3: Replace orchestrator + SSE tests with integration tests
stakepeter May 13, 2026
858b3e4
Phase D: Replace proposals_test with integration tests
stakepeter May 13, 2026
afc488b
Phase E: Add fixture-backed attestation tests, rename unit tests
stakepeter May 13, 2026
a11c324
Phase F: Rename remaining unit tests to integration; add real-block c…
stakepeter May 13, 2026
d32852e
Update CLAUDE.md to reflect post-migration test layout
stakepeter May 13, 2026
2b97348
Fix two stale references in CLAUDE.md (second audit pass)
stakepeter May 13, 2026
b6101eb
Reorganize fixtures into per-scenario + chain-level layout; head-stre…
stakepeter May 13, 2026
61fdcea
Migrate go-eth2-client to stakefish fork; fix Caplin missed-slot crash
stakepeter May 13, 2026
ccc53ae
Add beaconcha.in correctness E2E test; expand test-e2e Makefile target
stakepeter May 13, 2026
88269db
Update CLAUDE.md for the beaconcha.in E2E commit; drop untracked docs…
stakepeter May 13, 2026
97823dc
Bump x/net to v0.53.0, x/crypto to v0.50.0; clear 11 transitive CVEs
stakepeter May 13, 2026
1efd600
Add supervisor + signal-aware shutdown + SSE auto-resubscribe
stakepeter May 13, 2026
5936dd0
Label attestation effectiveness metrics by (validator_index, pubkey)
stakepeter May 13, 2026
33d7f23
Expose chain identity via ETH2_info for dashboard host swap
stakepeter May 13, 2026
43262c5
Rebuild Grafana dashboard for per-validator labels + chain-aware host
stakepeter May 13, 2026
27de422
Update CLAUDE.md for per-validator labels + ETH2_info gauge
stakepeter May 13, 2026
5ccad42
Dashboard: cluster-level deficit panels, distance distribution bar ch…
stakepeter May 13, 2026
f458a5d
Dashboard: move cluster-level panels under Clusters row; histogram pa…
stakepeter May 13, 2026
385a87d
Dashboard: replace fixed $window with $__range / $__rate_interval
stakepeter May 13, 2026
6f74117
Dashboard: render integer count columns without decimals
stakepeter May 13, 2026
6e08b71
Dashboard: drop per-validator state-timeline panels
stakepeter May 13, 2026
191c215
Dashboard: let Validators table columns flex to screen width
stakepeter May 13, 2026
773324f
Dashboard: exclude missed-block 404s from API Errors stat
stakepeter May 13, 2026
ee6b2e2
Dashboard: expand Validator Clusters table with rate columns + delaye…
stakepeter May 14, 2026
eb1207f
Dashboard: drop Distance loss series from Attestation deficit panel
stakepeter May 14, 2026
41420d0
Dashboard: convert Attester effectiveness panel from 7d rolling to re…
stakepeter May 14, 2026
b7b997d
Dashboard: pin Attester effectiveness rate window to 15m to fix oscil…
stakepeter May 14, 2026
9ced82d
Dashboard: pin epoch-stepped rate windows to [15m] across remaining p…
stakepeter May 14, 2026
d0d919e
Dashboard: add fleet-wide stat tiles for Success / Missed / Delayed >…
stakepeter May 14, 2026
d851384
Dashboard: fix API Errors "No data" via or-vector(0) fallback
stakepeter May 14, 2026
2446cd2
Dashboard: remove "About this dashboard" row and its 8 markdown panels
stakepeter May 14, 2026
5f0026c
Dashboard: drop Duplicate Attestations Skipped panel
stakepeter May 14, 2026
50bdcb1
Dashboard: expand all rows by default
stakepeter May 14, 2026
36292b6
Dashboard: unify all short rate windows to [15m]
stakepeter May 14, 2026
b16e239
Dashboard: strip effectiveness jargon and simplify opaque formulas
stakepeter May 14, 2026
7119f5c
Dashboard: render sparkline backgrounds on Global health stat tiles
stakepeter May 14, 2026
b053db2
Dashboard: drop Proposer Success % (24h) stat tile
stakepeter May 14, 2026
f7b0b5a
Dashboard: rebalance Global health stat tiles into 4+3 full-width rows
stakepeter May 14, 2026
1fbd0dd
Dashboard: add Attestation served rate diagrams + hide Served column
stakepeter May 14, 2026
f63fb25
Dashboard: reorder Validators table metrics to Success % first
stakepeter May 14, 2026
83634ad
Dashboard: hardcode "Problematic only" — drop view_mode variable
stakepeter May 14, 2026
3baf53f
Dashboard: unify operator-visible "container" terminology to "cluster"
stakepeter May 14, 2026
b813432
Dashboard: add Total Served / Missed / Delayed >tol absolute-count tiles
stakepeter May 14, 2026
92a65c7
Dashboard: switch percent-rate tiles to mean reducer
stakepeter May 14, 2026
2fd584d
Dashboard: render sparklines behind the 3 Total tiles
stakepeter May 14, 2026
f7dc374
Dashboard: render distance distribution histograms with percentage y-…
stakepeter May 14, 2026
4a1b978
Dashboard: label histogram x-axis as Distance
stakepeter May 14, 2026
a6ef844
Dashboard: add per-validator timeseries panels under the Validators t…
stakepeter May 14, 2026
7435a95
Dashboard: switch per-validator served panel from rate to accumulated…
stakepeter May 14, 2026
814cdc0
Dashboard: diagrams first, table below in Validators row; hide diagra…
stakepeter May 14, 2026
67f49b2
CLAUDE.md: document supervisor + SSE-retry layer
stakepeter May 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.23'
go-version: '1.25'
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v8
with:
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.60

# XXX Workaround for https://github.com/golangci/golangci-lint-action/issues/135
# Optional: if set to true, then the action won't cache or restore ~/go/pkg.
skip-pkg-cache: true
# When `install-mode` is `binary` (default) the value can be v2.x.y or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v2.x.y, `latest`, or the hash of a commit.
version: v2.12.2

# Optional: working directory, useful for monorepos
# working-directory: somedir
Expand All @@ -51,3 +47,15 @@ jobs:

# Optional: The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
# install-mode: "goinstall"

coverage:
name: coverage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.25'
cache: false
- name: go test -cover
run: go test -cover ./...
15 changes: 13 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,24 @@ jobs:
# run: |
# go get -u github.com/client9/misspell/cmd/misspell
# $(go env GOPATH)/bin/misspell -locale US *.md $(find . -name '*.go')
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.25.x
- name: go test
run: go test ./...
build:
name: Build the executable
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.23.x
go-version: 1.25.x
- uses: actions/checkout@v3
- name: Build
run: |
Expand All @@ -49,7 +60,7 @@ jobs:
}

mkdir -p build
for arch in arm64 arm64; do
for arch in amd64 arm64; do
for os in linux darwin freebsd windows; do
build "$arch" "$os"
done
Expand Down
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,12 @@ eth2-monitor
test-env/data/
test-env/mev-relays.json
test-env/.env

.idea
.serena
.env

# accidental `go build ./tools/fixturegen` from the repo root drops the
# binary here; the tool is meant to be run via `go run ./tools/fixturegen`
# or `make refresh-fixtures`, never built into the source tree.
/fixturegen
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
golang 1.19.3
golang 1.25.10
281 changes: 281 additions & 0 deletions CLAUDE.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:alpine3.19 AS builder
FROM golang:1.25.10-alpine3.23 AS builder

RUN apk update && \
apk add --no-cache ca-certificates && \
Expand All @@ -16,10 +16,10 @@ RUN go mod download
RUN go mod verify

COPY . .
RUN go build -o /go/bin/eth2-monitor -ldflags '-extldflags "-static"'
RUN go build -o /go/bin/eth2-monitor -ldflags '-extldflags "-static"' ./cmd/eth2-monitor

# second step to build minimal image
FROM alpine:3.21.3
FROM alpine:3.23

# add common trusted certificates from the build stage
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Expand Down
46 changes: 43 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,53 @@
VERSION = $(shell git describe --tags --abbrev=8 2>/dev/null)

LDFLAGS += -X eth2-monitor/cmd.version=${VERSION}
LDFLAGS += -X github.com/stakefish/eth2-monitor/internal/cli.version=${VERSION}

.PHONY: all build eth2-monitor
.PHONY: all build eth2-monitor lint test test-e2e refresh-fixtures refresh-scenario
all: build

build: eth2-monitor

eth2-monitor:
-@mkdir -p bin
-@rm -f bin/$@
go build -ldflags '$(LDFLAGS)' -o bin/$@ .
go build -ldflags '$(LDFLAGS)' -o bin/$@ ./cmd/eth2-monitor

lint:
golangci-lint run ./...

test:
go test -cover ./...

test-e2e:
go test -tags=e2e -count=1 -timeout=5m ./internal/beaconchain/... ./internal/monitoring/...

# Scenarios captured by tools/fixturegen. Each scenario gets its own
# subdirectory under internal/beaconchain/testdata/beacon/<chain>/<scenario>/
# (plus internal/monitoring/testdata/mev/ for the chain-agnostic mev
# scenario). The head-stream-driven capture flow waits for live head
# events on the configured BEACON_CHAIN_API endpoint — see
# tools/fixturegen/main.go.
SCENARIOS = _shared happy_path missed_proposal empty_block delayed_attestation cross_epoch_attestation mev

# CHAIN selects the chain subdirectory under testdata/beacon/. Defaults
# to hoodi (the chain configured in test-env/.env). Set explicitly to
# capture against a different network:
# make refresh-fixtures CHAIN=sepolia
CHAIN ?= hoodi

# Refresh every scenario sequentially. The head-stream selectors each
# wait up to ~10 minutes for a matching head event, so a full
# refresh-fixtures run can take 30-60 minutes on a normal-finality
# testnet. Use refresh-scenario for targeted refreshes during
# development. Reads $BEACON_CHAIN_API or test-env/.env.
refresh-fixtures:
@for s in $(SCENARIOS); do \
echo "==> capturing scenario: $$s (chain=$(CHAIN))"; \
go run ./tools/fixturegen --scenario=$$s --chain=$(CHAIN) || exit 1; \
done

# Refresh a single scenario. Pass `SCENARIO=<name>` (e.g.
# `make refresh-scenario SCENARIO=missed_proposal`). Honors CHAIN.
refresh-scenario:
@if [ -z "$(SCENARIO)" ]; then echo "usage: make refresh-scenario SCENARIO=<name> [CHAIN=<chain>]"; exit 2; fi
go run ./tools/fixturegen --scenario=$(SCENARIO) --chain=$(CHAIN)
166 changes: 0 additions & 166 deletions beaconchain/service.go

This file was deleted.

4 changes: 2 additions & 2 deletions main.go → cmd/eth2-monitor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"os"
"time"

"eth2-monitor/cmd"
"github.com/stakefish/eth2-monitor/internal/cli"

isatty "github.com/mattn/go-isatty"
"github.com/rs/zerolog"
Expand All @@ -24,7 +24,7 @@ func init() {
}

func main() {
if err := cmd.Execute(); err != nil {
if err := cli.Execute(); err != nil {
fmt.Println(err)
os.Exit(1)
}
Expand Down
29 changes: 0 additions & 29 deletions cmd/opts/opts.go

This file was deleted.

Loading
Loading