Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
401b1f9
fix(block/syncing): broadcast on sync nodes
julienrbrt Oct 6, 2025
a778aac
wording
julienrbrt Oct 6, 2025
18ec45d
typo
julienrbrt Oct 6, 2025
aaecf39
simplify!!
julienrbrt Oct 6, 2025
2fade27
tests
julienrbrt Oct 6, 2025
1eba937
trusting period + async save
julienrbrt Oct 6, 2025
2991c64
revert to writetostoreandbroadcast
tac0turtle Oct 6, 2025
510de9e
update the syner to ignore empty datahashes
tac0turtle Oct 6, 2025
26a7922
timing hack
tac0turtle Oct 6, 2025
253841c
add source to event for processing
tac0turtle Oct 6, 2025
42d0910
cleanups + fix tests
julienrbrt Oct 6, 2025
894f877
speedup processing
julienrbrt Oct 6, 2025
bc2eb11
prevent double fetching
julienrbrt Oct 6, 2025
75bb6c0
submit p2p heights directly
julienrbrt Oct 7, 2025
f9a9928
fix tests
julienrbrt Oct 7, 2025
76825cd
Merge branch 'main' into julien/sync-p2p
julienrbrt Oct 7, 2025
1a800bf
updates
julienrbrt Oct 7, 2025
a6efeb8
Merge branch 'main' into julien/sync-p2p
julienrbrt Oct 7, 2025
0f8ac38
Merge branch 'main' into julien/sync-p2p
julienrbrt Oct 7, 2025
4f482ae
updates
julienrbrt Oct 8, 2025
5c30004
updares
julienrbrt Oct 8, 2025
50c17d4
align p2p handler with p2p broadcast
julienrbrt Oct 8, 2025
c918bde
align with executor
julienrbrt Oct 8, 2025
104c01f
add last data for empty data
julienrbrt Oct 8, 2025
0b142b3
comment
julienrbrt Oct 8, 2025
6229481
Merge branch 'main' into julien/sync-p2p
julienrbrt Oct 8, 2025
e3f2687
do not broadcast on sync node
julienrbrt Oct 9, 2025
0eb1c76
reduce diff
julienrbrt Oct 9, 2025
d2631e9
Merge branch 'main' into julien/sync-p2p
julienrbrt Oct 9, 2025
576b71a
reduce diff
julienrbrt Oct 9, 2025
ca0f992
temp comment append
julienrbrt Oct 9, 2025
8a4c7d5
Merge branch 'main' into julien/sync-p2p
tac0turtle Oct 9, 2025
31e7659
Merge branch 'main' into julien/sync-p2p
julienrbrt Oct 9, 2025
ff652f3
uncomment append
julienrbrt Oct 9, 2025
2dc46a4
reduce diffsu
julienrbrt Oct 9, 2025
3ec6335
revert to writetostoreandbroadcast
tac0turtle Oct 13, 2025
1d8b50b
check height
tac0turtle Oct 13, 2025
f8a0edb
single interface and fix tests
tac0turtle Oct 13, 2025
1a20eb6
Merge branch 'main' into julien/sync-p2p
tac0turtle Oct 13, 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
Prev Previous commit
Next Next commit
reduce diff
  • Loading branch information
julienrbrt committed Oct 9, 2025
commit 0eb1c766a2d5444ce5bb0682d895863cca96bc27
16 changes: 8 additions & 8 deletions block/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"fmt"

"github.com/celestiaorg/go-header"
goheader "github.com/celestiaorg/go-header"
"github.com/rs/zerolog"

"github.com/evstack/ev-node/block/internal/cache"
Expand Down Expand Up @@ -122,6 +122,11 @@ func (bc *Components) Stop() error {
return errs
}

// broadcaster interface for P2P broadcasting
type broadcaster[T any] interface {
WriteToStoreAndBroadcast(ctx context.Context, payload T) error
}

// NewSyncComponents creates components for a non-aggregator full node that can only sync blocks.
// Non-aggregator full nodes can sync from P2P and DA but cannot produce blocks or submit to DA.
// They have more sync capabilities than light nodes but no block production. No signer required.
Expand All @@ -131,8 +136,8 @@ func NewSyncComponents(
store store.Store,
exec coreexecutor.Executor,
da coreda.DA,
headerStore header.Store[*types.SignedHeader],
dataStore header.Store[*types.Data],
headerStore goheader.Store[*types.SignedHeader],
dataStore goheader.Store[*types.Data],
logger zerolog.Logger,
metrics *Metrics,
blockOpts BlockOptions,
Expand Down Expand Up @@ -183,11 +188,6 @@ func NewSyncComponents(
}, nil
}

// broadcaster interface for P2P broadcasting
type broadcaster[T any] interface {
WriteToStoreAndBroadcast(ctx context.Context, payload T) error
}

// NewAggregatorComponents creates components for an aggregator full node that can produce and sync blocks.
// Aggregator nodes have full capabilities - they can produce blocks, sync from P2P and DA,
// and submit headers/data to DA. Requires a signer for block production and DA submission.
Expand Down
2 changes: 1 addition & 1 deletion block/internal/executing/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type Executor struct {
cache cache.Manager
metrics *common.Metrics

// P2P handling
// Broadcasting
headerBroadcaster broadcaster[*types.SignedHeader]
dataBroadcaster broadcaster[*types.Data]

Expand Down
7 changes: 1 addition & 6 deletions block/internal/executing/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"testing"
"time"

goheader "github.com/celestiaorg/go-header"
"github.com/ipfs/go-datastore"
"github.com/ipfs/go-datastore/sync"
"github.com/rs/zerolog"
Expand All @@ -21,7 +20,7 @@ import (
)

// mockBroadcaster for testing
type mockBroadcaster[T goheader.Header[T]] struct {
type mockBroadcaster[T any] struct {
called bool
payload T
}
Expand All @@ -32,10 +31,6 @@ func (m *mockBroadcaster[T]) WriteToStoreAndBroadcast(ctx context.Context, paylo
return nil
}

func (m *mockBroadcaster[T]) Store() goheader.Store[T] {
panic("should not be needed")
}

func TestExecutor_BroadcasterIntegration(t *testing.T) {
// Create in-memory store
ds := sync.MutexWrap(datastore.NewMapDatastore())
Expand Down
Loading