Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ require (
require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/OffchainLabs/go-bitfield v0.0.0-20251031151322-f427d04d8506 // indirect
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.20.0 // indirect
Expand Down Expand Up @@ -122,3 +121,5 @@ require (
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.46.1 // indirect
)

replace github.com/attestantio/go-eth2-client => github.com/qu0b/go-eth2-client v0.0.0-20260211134817-89b1d064a7e5
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,10 @@ github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc
github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
github.com/OffchainLabs/go-bitfield v0.0.0-20251031151322-f427d04d8506 h1:d/SJkN8/9Ca+1YmuDiUJxAiV4w/a9S8NcsG7GMQSrVI=
github.com/OffchainLabs/go-bitfield v0.0.0-20251031151322-f427d04d8506/go.mod h1:6TZI4FU6zT8x6ZfWa1J8YQ2NgW0wLV/W3fHRca8ISBo=
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 h1:1zYrtlhrZ6/b6SAjLSfKzWtdgqK0U+HtH/VcBWh1BaU=
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI=
github.com/VictoriaMetrics/fastcache v1.13.0 h1:AW4mheMR5Vd9FkAPUv+NH6Nhw+fmbTMGMsNAoA/+4G0=
github.com/VictoriaMetrics/fastcache v1.13.0/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU=
github.com/attestantio/go-eth2-client v0.28.0 h1:2zIIIMPvSD+g6h3TgVXsoda/Yw3e+wjo1e8CZEanORU=
github.com/attestantio/go-eth2-client v0.28.0/go.mod h1:PO9sHFCq+1RiG+Eh3eOR2GYvYV64Qzg7idM3kLgCs5k=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU=
Expand Down Expand Up @@ -280,6 +276,8 @@ github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15 h1:lC8ki
github.com/prysmaticlabs/go-bitfield v0.0.0-20240618144021-706c95b2dd15/go.mod h1:8svFBIKKu31YriBG/pNizo9N0Jr9i5PQ+dFkxWg3x5k=
github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkqOOVnWapUyeWro4=
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
github.com/qu0b/go-eth2-client v0.0.0-20260211134817-89b1d064a7e5 h1:KhHr85BKhGb+5q8npUuMTxwcUGvtzk9P3ZnBwd++Tbo=
github.com/qu0b/go-eth2-client v0.0.0-20260211134817-89b1d064a7e5/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
github.com/r3labs/sse/v2 v2.10.0 h1:hFEkLLFY4LDifoHdiCN/LlGBAdVJYsANaLqNYa1l/v0=
github.com/r3labs/sse/v2 v2.10.0/go.mod h1:Igau6Whc+F17QUgML1fYe1VPZzTV6EMCnYktEmkNJ7I=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
Expand Down
27 changes: 26 additions & 1 deletion pkg/clients/consensus/block_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/attestantio/go-eth2-client/spec"
)

//nolint:gocyclo // switch over all fork versions
func GetExecutionExtraData(v *spec.VersionedSignedBeaconBlock) ([]byte, error) {
//nolint:exhaustive // ignore
switch v.Version {
Expand All @@ -23,10 +24,28 @@ func GetExecutionExtraData(v *spec.VersionedSignedBeaconBlock) ([]byte, error) {
return v.Capella.Message.Body.ExecutionPayload.ExtraData, nil
case spec.DataVersionDeneb:
if v.Deneb == nil || v.Deneb.Message == nil || v.Deneb.Message.Body == nil || v.Deneb.Message.Body.ExecutionPayload == nil {
return nil, errors.New("no denb block")
return nil, errors.New("no deneb block")
}

return v.Deneb.Message.Body.ExecutionPayload.ExtraData, nil
case spec.DataVersionElectra:
if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || v.Electra.Message.Body.ExecutionPayload == nil {
return nil, errors.New("no electra block")
}

return v.Electra.Message.Body.ExecutionPayload.ExtraData, nil
case spec.DataVersionFulu:
if v.Fulu == nil || v.Fulu.Message == nil || v.Fulu.Message.Body == nil || v.Fulu.Message.Body.ExecutionPayload == nil {
return nil, errors.New("no fulu block")
}

return v.Fulu.Message.Body.ExecutionPayload.ExtraData, nil
case spec.DataVersionGloas:
if v.Gloas == nil || v.Gloas.Message == nil || v.Gloas.Message.Body == nil || v.Gloas.Message.Body.ExecutionPayload == nil {
return nil, errors.New("no gloas block")
}

return v.Gloas.Message.Body.ExecutionPayload.ExtraData, nil
default:
return nil, errors.New("unknown version")
}
Expand All @@ -45,6 +64,12 @@ func GetBlockBody(v *spec.VersionedSignedBeaconBlock) any {
return v.Capella
case spec.DataVersionDeneb:
return v.Deneb
case spec.DataVersionElectra:
return v.Electra
case spec.DataVersionFulu:
return v.Fulu
case spec.DataVersionGloas:
return v.Gloas
default:
return nil
}
Expand Down
12 changes: 11 additions & 1 deletion pkg/tasks/check_consensus_attestation_stats/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,17 @@ func (t *Task) aggregateEpochVotes(ctx context.Context, epoch uint64) []*epochVo
aggregationBitsOffset := uint64(0)

for committee := uint64(0); committee < specs.MaxCommitteesPerSlot; committee++ {
if !committeeBits.BitAt(committee) {
// Workaround for go-bitfield Bitvector64 requiring exactly 8 bytes.
// With minimal preset, committeeBits may be shorter. Check raw bytes directly.
byteIdx := committee / 8
bitIdx := committee % 8

hasBit := false
if int(byteIdx) < len(committeeBits) {
hasBit = committeeBits[byteIdx]&(1<<bitIdx) != 0
}

if !hasBit {
continue
}

Expand Down
Loading
Loading