Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
904df11
basic eip7805 support (FOCIL)
pk910 Feb 11, 2025
cac66d7
trigger CI
pk910 Feb 11, 2025
e1cd242
bump go-eth2-client
pk910 Feb 11, 2025
b89cd01
Merge branch 'fulu-support' into eip7805-support
pk910 Feb 11, 2025
18ec4c3
Merge branch 'master' into eip7805-support
pk910 Feb 17, 2025
0718482
Display ILs per slot
jihoonsong Mar 11, 2025
1b59ea0
Merge pull request #272 from jihoonsong/eip7805-support
pk910 Mar 17, 2025
6e65662
Merge branch 'master' into eip7805-support
pk910 Mar 17, 2025
c840060
Merge remote-tracking branch 'origin/eip7805-support' into eip7805-su…
pk910 Mar 17, 2025
42d5134
fix staticcheck issue
pk910 Mar 17, 2025
b6a120f
Merge branch 'master' into eip7805-support
pk910 Mar 19, 2025
ed4eea3
Merge branch 'master' into eip7805-support
pk910 Apr 4, 2025
3f7d240
Merge branch 'master' into eip7805-support
pk910 Apr 4, 2025
bb1c637
Merge branch 'master' into eip7805-support
pk910 Apr 7, 2025
6d772f2
Merge branch 'master' into eip7805-support
barnabasbusa Apr 8, 2025
7e627a1
bump `go-eth2-client`
pk910 Apr 9, 2025
2263004
Merge branch 'master' into eip7805-support
pk910 Apr 24, 2025
0935f6a
Merge branch 'master' into eip7805-support
pk910 May 11, 2025
1a80b06
Merge branch 'master' into eip7805-support
pk910 May 12, 2025
2930122
Merge branch 'master' into eip7805-support
pk910 May 13, 2025
5ac7138
Merge branch 'master' into eip7805-support
pk910 May 22, 2025
f8b431a
Merge branch 'fulu-support' into eip7805-support
pk910 May 22, 2025
f7a1203
add missing block getters for eip7805
pk910 Aug 5, 2025
5d871f0
fix fallback block loading when eventstream fails
pk910 Aug 5, 2025
268f31b
Merge branch 'master' into eip7805-support
pk910 Sep 22, 2025
99dedc0
Merge branch 'master' into eip7805-support
pk910 Dec 15, 2025
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
2 changes: 2 additions & 0 deletions clients/consensus/chainspec.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ type ChainSpecConfig struct {
ElectraForkEpoch *uint64 `yaml:"ELECTRA_FORK_EPOCH" check-if-fork:"ElectraForkEpoch"`
FuluForkVersion phase0.Version `yaml:"FULU_FORK_VERSION" check-if-fork:"FuluForkEpoch"`
FuluForkEpoch *uint64 `yaml:"FULU_FORK_EPOCH" check-if-fork:"FuluForkEpoch"`
Eip7805ForkVersion phase0.Version `yaml:"EIP7805_FORK_VERSION" check-if-fork:"Eip7805ForkEpoch"`
Eip7805ForkEpoch *uint64 `yaml:"EIP7805_FORK_EPOCH" check-if-fork:"Eip7805ForkEpoch"`

// Time parameters
SecondsPerSlot uint64 `yaml:"SECONDS_PER_SLOT"`
Expand Down
5 changes: 5 additions & 0 deletions clients/consensus/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ type Client struct {
blockDispatcher utils.Dispatcher[*v1.BlockEvent]
headDispatcher utils.Dispatcher[*v1.HeadEvent]
checkpointDispatcher utils.Dispatcher[*v1.Finality]
inclusionListDispatcher utils.Dispatcher[*v1.InclusionListEvent]

specWarnings []string // warnings from incomplete spec checks
specs map[string]interface{}
Expand Down Expand Up @@ -102,6 +103,10 @@ func (client *Client) SubscribeFinalizedEvent(capacity int) *utils.Subscription[
return client.checkpointDispatcher.Subscribe(capacity, false)
}

func (client *Client) SubscribeInclusionListEvent(capacity int, blocking bool) *utils.Subscription[*v1.InclusionListEvent] {
return client.inclusionListDispatcher.Subscribe(capacity, blocking)
}

func (client *Client) GetPool() *Pool {
return client.pool
}
Expand Down
14 changes: 13 additions & 1 deletion clients/consensus/clientlogic.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (client *Client) runClientLogic() error {
}

// start event stream
blockStream := client.rpcClient.NewBlockStream(client.clientCtx, client.logger, rpc.StreamBlockEvent|rpc.StreamHeadEvent|rpc.StreamFinalizedEvent)
blockStream := client.rpcClient.NewBlockStream(client.clientCtx, client.logger, rpc.StreamBlockEvent|rpc.StreamHeadEvent|rpc.StreamFinalizedEvent|rpc.StreamInclusionListEvent)
defer blockStream.Close()

// process events
Expand Down Expand Up @@ -171,6 +171,12 @@ func (client *Client) runClientLogic() error {
if err != nil {
client.logger.Warnf("failed processing finalized event: %v", err)
}

case rpc.StreamInclusionListEvent:
err := client.processInclusionListEvent(evt.Data.(*v1.InclusionListEvent))
if err != nil {
client.logger.Warnf("failed processing inclusion list event: %v", err)
}
}

client.logger.Tracef("event (%v) processing time: %v ms", evt.Event, time.Since(now).Milliseconds())
Expand Down Expand Up @@ -367,6 +373,12 @@ func (client *Client) processFinalizedEvent(evt *v1.FinalizedCheckpointEvent) er
return nil
}

func (client *Client) processInclusionListEvent(evt *v1.InclusionListEvent) error {
client.inclusionListDispatcher.Fire(evt)

return nil
}

func (client *Client) pollClientHead() error {
ctx, cancel := context.WithTimeout(client.clientCtx, 10*time.Second)
defer cancel()
Expand Down
34 changes: 31 additions & 3 deletions clients/consensus/rpc/beaconstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ import (
)

const (
StreamBlockEvent uint16 = 0x01
StreamHeadEvent uint16 = 0x02
StreamFinalizedEvent uint16 = 0x04
StreamBlockEvent uint16 = 0x01
StreamHeadEvent uint16 = 0x02
StreamFinalizedEvent uint16 = 0x04
StreamInclusionListEvent uint16 = 0x08
)

type BeaconStreamEvent struct {
Expand Down Expand Up @@ -87,6 +88,8 @@ func (bs *BeaconStream) startStream() {
bs.processHeadEvent(evt)
case "finalized_checkpoint":
bs.processFinalizedEvent(evt)
case "inclusion_list":
bs.processInclusionListEvent(evt)
}
case <-stream.Ready:
bs.ReadyChan <- &BeaconStreamStatus{
Expand Down Expand Up @@ -148,6 +151,16 @@ func (bs *BeaconStream) subscribeStream(endpoint string, events uint16) *eventst
topicsCount++
}

if events&StreamInclusionListEvent > 0 {
if topicsCount > 0 {
fmt.Fprintf(&topics, ",")
}

fmt.Fprintf(&topics, "inclusion_list")

topicsCount++
}

if topicsCount == 0 {
return nil
}
Expand Down Expand Up @@ -225,6 +238,21 @@ func (bs *BeaconStream) processFinalizedEvent(evt eventsource.Event) {
}
}

func (bs *BeaconStream) processInclusionListEvent(evt eventsource.Event) {
var parsed v1.InclusionListEvent

err := json.Unmarshal([]byte(evt.Data()), &parsed)
if err != nil {
bs.logger.Warnf("beacon block stream failed to decode inclusion_list event: %v", err)
return
}

bs.EventChan <- &BeaconStreamEvent{
Event: StreamInclusionListEvent,
Data: &parsed,
}
}

func getRedactedURL(requrl string) string {
var logurl string

Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ require (
require (
github.com/DataDog/zstd v1.5.7 // indirect
github.com/KyleBanks/depth v1.2.1 // 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/VictoriaMetrics/fastcache v1.13.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
Expand Down Expand Up @@ -259,3 +258,5 @@ require (
modernc.org/memory v1.11.0 // indirect
modernc.org/sqlite v1.38.2 // indirect
)

replace github.com/attestantio/go-eth2-client => github.com/pk910/go-eth2-client v0.0.0-20250922213047-288b5f58a08e
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,13 @@ github.com/Masterminds/sprig/v3 v3.3.0 h1:mQh0Yrg1XPo6vjYXgtf5OtijNAKJRNcTdOOGZe
github.com/Masterminds/sprig/v3 v3.3.0/go.mod h1:Zy1iXRYNqNLUolqCpL4uhk6SHUMAOSCzdgBfDb35Lz0=
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/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8=
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c=
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/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o=
github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
Expand Down Expand Up @@ -568,6 +564,8 @@ github.com/pion/webrtc/v4 v4.1.4 h1:/gK1ACGHXQmtyVVbJFQDxNoODg4eSRiFLB7t9r9pg8M=
github.com/pion/webrtc/v4 v4.1.4/go.mod h1:Oab9npu1iZtQRMic3K3toYq5zFPvToe/QBw7dMI2ok4=
github.com/pk910/dynamic-ssz v1.1.2 h1:NgovfI4bTKGoHipahOZXtEM8K+UPHW9M5MKEFvhu1sc=
github.com/pk910/dynamic-ssz v1.1.2/go.mod h1:HXRWLNcgj3DL65Kznrb+RdL3DEKw2JBZ/6crooqGoII=
github.com/pk910/go-eth2-client v0.0.0-20250922213047-288b5f58a08e h1:4KVrpCeKGViR3S/byg4lGYFRX4HZJEKfSxRoWUTyH/o=
github.com/pk910/go-eth2-client v0.0.0-20250922213047-288b5f58a08e/go.mod h1:fvULSL9WtNskkOB4i+Yyr6BKpNHXvmpGZj9969fCrfY=
github.com/pk910/hashtree-bindings v0.0.1 h1:Sw+UlPlrBle4LUg04kqLFybVQcfmamwKL1QsrR3GU0g=
github.com/pk910/hashtree-bindings v0.0.1/go.mod h1:eayIpxMFkWzMsydESu/5bV8wglZzSE/c9mq6DQdn204=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
Expand Down
8 changes: 8 additions & 0 deletions handlers/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ func buildIndexPageData() (*models.IndexPageData, time.Duration) {
ForkDigest: forkDigest[:],
})
}
if specs.Eip7805ForkEpoch != nil && *specs.Eip7805ForkEpoch < uint64(18446744073709551615) {
pageData.NetworkForks = append(pageData.NetworkForks, &models.IndexPageDataForks{
Name: "eip7805",
Epoch: *specs.Eip7805ForkEpoch,
Version: specs.Eip7805ForkVersion[:],
Active: uint64(currentEpoch) >= *specs.Eip7805ForkEpoch,
})
}

// Add BPO forks from BLOB_SCHEDULE
elBlobSchedule := services.GlobalBeaconService.GetExecutionChainState().GetFullBlobSchedule()
Expand Down
Loading