Skip to content

Commit 6962e6f

Browse files
committed
Merge branch 'main' into alex/2609_hints
* main: build(deps): Bump the all-go group across 5 directories with 5 updates (#2999) feat(tracing): adding forced inclusion tracing (#2997)
2 parents 6e4554d + 140b24a commit 6962e6f

File tree

23 files changed

+229
-164
lines changed

23 files changed

+229
-164
lines changed

apps/evm/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ replace (
99
)
1010

1111
require (
12-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2
12+
github.com/celestiaorg/go-header v0.8.0
1313
github.com/ethereum/go-ethereum v1.16.8
1414
github.com/evstack/ev-node v1.0.0-beta.10
1515
github.com/evstack/ev-node/core v1.0.0-beta.5
@@ -90,7 +90,7 @@ require (
9090
github.com/libp2p/go-flow-metrics v0.3.0 // indirect
9191
github.com/libp2p/go-libp2p v0.46.0 // indirect
9292
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
93-
github.com/libp2p/go-libp2p-kad-dht v0.36.0 // indirect
93+
github.com/libp2p/go-libp2p-kad-dht v0.37.0 // indirect
9494
github.com/libp2p/go-libp2p-kbucket v0.8.0 // indirect
9595
github.com/libp2p/go-libp2p-pubsub v0.15.0 // indirect
9696
github.com/libp2p/go-libp2p-record v0.3.1 // indirect

apps/evm/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3M
269269
github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
270270
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
271271
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
272-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2 h1:jvRM1RT60oRy8jCneGYdX61Y8U2dI9uxjqT87H8uWq4=
273-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2/go.mod h1:X00prITrMa2kxgEX15WQnbLf0uV6tlvTesDKC5KsDVQ=
272+
github.com/celestiaorg/go-header v0.8.0 h1:j9/t/uhxif26WQ3fULDAh3I55Fh3lJk6qMXPFFuOy28=
273+
github.com/celestiaorg/go-header v0.8.0/go.mod h1:X00prITrMa2kxgEX15WQnbLf0uV6tlvTesDKC5KsDVQ=
274274
github.com/celestiaorg/go-libp2p-messenger v0.2.2 h1:osoUfqjss7vWTIZrrDSy953RjQz+ps/vBFE7bychLEc=
275275
github.com/celestiaorg/go-libp2p-messenger v0.2.2/go.mod h1:oTCRV5TfdO7V/k6nkx7QjQzGrWuJbupv+0o1cgnY2i4=
276276
github.com/celestiaorg/go-square/merkle v0.0.0-20240627094109-7d01436067a3 h1:wP84mtwOCVNOTfS3zErICjxKLnh74Z1uf+tdrlSFjVM=
@@ -688,8 +688,8 @@ github.com/libp2p/go-libp2p v0.46.0 h1:0T2yvIKpZ3DVYCuPOFxPD1layhRU486pj9rSlGWYn
688688
github.com/libp2p/go-libp2p v0.46.0/go.mod h1:TbIDnpDjBLa7isdgYpbxozIVPBTmM/7qKOJP4SFySrQ=
689689
github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94=
690690
github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8=
691-
github.com/libp2p/go-libp2p-kad-dht v0.36.0 h1:7QuXhV36+Vyj+L6A7mrYkn2sYLrbRcbjvsYDu/gXhn8=
692-
github.com/libp2p/go-libp2p-kad-dht v0.36.0/go.mod h1:O24LxTH9Rt3I5XU8nmiA9VynS4TrTwAyj+zBJKB05vQ=
691+
github.com/libp2p/go-libp2p-kad-dht v0.37.0 h1:V1IkFzK9taNS1UNAx260foulcBPH+watAUFjNo2qMUY=
692+
github.com/libp2p/go-libp2p-kad-dht v0.37.0/go.mod h1:o4FPa1ea++UVAMJ1c+kyjUmj3CKm9+ZCyzQb4uutCFM=
693693
github.com/libp2p/go-libp2p-kbucket v0.8.0 h1:QAK7RzKJpYe+EuSEATAaaHYMYLkPDGC18m9jxPLnU8s=
694694
github.com/libp2p/go-libp2p-kbucket v0.8.0/go.mod h1:JMlxqcEyKwO6ox716eyC0hmiduSWZZl6JY93mGaaqc4=
695695
github.com/libp2p/go-libp2p-pubsub v0.15.0 h1:cG7Cng2BT82WttmPFMi50gDNV+58K626m/wR00vGL1o=

apps/grpc/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
connectrpc.com/grpcreflect v1.3.0 // indirect
2323
github.com/benbjohnson/clock v1.3.5 // indirect
2424
github.com/beorn7/perks v1.0.1 // indirect
25-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2 // indirect
25+
github.com/celestiaorg/go-header v0.8.0 // indirect
2626
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
2727
github.com/celestiaorg/go-square/merkle v0.0.0-20240627094109-7d01436067a3 // indirect
2828
github.com/celestiaorg/go-square/v3 v3.0.2 // indirect
@@ -70,7 +70,7 @@ require (
7070
github.com/libp2p/go-flow-metrics v0.3.0 // indirect
7171
github.com/libp2p/go-libp2p v0.46.0 // indirect
7272
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
73-
github.com/libp2p/go-libp2p-kad-dht v0.36.0 // indirect
73+
github.com/libp2p/go-libp2p-kad-dht v0.37.0 // indirect
7474
github.com/libp2p/go-libp2p-kbucket v0.8.0 // indirect
7575
github.com/libp2p/go-libp2p-pubsub v0.15.0 // indirect
7676
github.com/libp2p/go-libp2p-record v0.3.1 // indirect

apps/grpc/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
257257
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
258258
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
259259
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
260-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2 h1:jvRM1RT60oRy8jCneGYdX61Y8U2dI9uxjqT87H8uWq4=
261-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2/go.mod h1:X00prITrMa2kxgEX15WQnbLf0uV6tlvTesDKC5KsDVQ=
260+
github.com/celestiaorg/go-header v0.8.0 h1:j9/t/uhxif26WQ3fULDAh3I55Fh3lJk6qMXPFFuOy28=
261+
github.com/celestiaorg/go-header v0.8.0/go.mod h1:X00prITrMa2kxgEX15WQnbLf0uV6tlvTesDKC5KsDVQ=
262262
github.com/celestiaorg/go-libp2p-messenger v0.2.2 h1:osoUfqjss7vWTIZrrDSy953RjQz+ps/vBFE7bychLEc=
263263
github.com/celestiaorg/go-libp2p-messenger v0.2.2/go.mod h1:oTCRV5TfdO7V/k6nkx7QjQzGrWuJbupv+0o1cgnY2i4=
264264
github.com/celestiaorg/go-square/merkle v0.0.0-20240627094109-7d01436067a3 h1:wP84mtwOCVNOTfS3zErICjxKLnh74Z1uf+tdrlSFjVM=
@@ -618,8 +618,8 @@ github.com/libp2p/go-libp2p v0.46.0 h1:0T2yvIKpZ3DVYCuPOFxPD1layhRU486pj9rSlGWYn
618618
github.com/libp2p/go-libp2p v0.46.0/go.mod h1:TbIDnpDjBLa7isdgYpbxozIVPBTmM/7qKOJP4SFySrQ=
619619
github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94=
620620
github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8=
621-
github.com/libp2p/go-libp2p-kad-dht v0.36.0 h1:7QuXhV36+Vyj+L6A7mrYkn2sYLrbRcbjvsYDu/gXhn8=
622-
github.com/libp2p/go-libp2p-kad-dht v0.36.0/go.mod h1:O24LxTH9Rt3I5XU8nmiA9VynS4TrTwAyj+zBJKB05vQ=
621+
github.com/libp2p/go-libp2p-kad-dht v0.37.0 h1:V1IkFzK9taNS1UNAx260foulcBPH+watAUFjNo2qMUY=
622+
github.com/libp2p/go-libp2p-kad-dht v0.37.0/go.mod h1:o4FPa1ea++UVAMJ1c+kyjUmj3CKm9+ZCyzQb4uutCFM=
623623
github.com/libp2p/go-libp2p-kbucket v0.8.0 h1:QAK7RzKJpYe+EuSEATAaaHYMYLkPDGC18m9jxPLnU8s=
624624
github.com/libp2p/go-libp2p-kbucket v0.8.0/go.mod h1:JMlxqcEyKwO6ox716eyC0hmiduSWZZl6JY93mGaaqc4=
625625
github.com/libp2p/go-libp2p-pubsub v0.15.0 h1:cG7Cng2BT82WttmPFMi50gDNV+58K626m/wR00vGL1o=

apps/testapp/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ replace (
88
)
99

1010
require (
11-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2
11+
github.com/celestiaorg/go-header v0.8.0
1212
github.com/evstack/ev-node v1.0.0-beta.10
1313
github.com/evstack/ev-node/core v1.0.0-beta.5
1414
github.com/ipfs/go-datastore v0.9.0
@@ -69,7 +69,7 @@ require (
6969
github.com/libp2p/go-flow-metrics v0.3.0 // indirect
7070
github.com/libp2p/go-libp2p v0.46.0 // indirect
7171
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
72-
github.com/libp2p/go-libp2p-kad-dht v0.36.0 // indirect
72+
github.com/libp2p/go-libp2p-kad-dht v0.37.0 // indirect
7373
github.com/libp2p/go-libp2p-kbucket v0.8.0 // indirect
7474
github.com/libp2p/go-libp2p-pubsub v0.15.0 // indirect
7575
github.com/libp2p/go-libp2p-record v0.3.1 // indirect

apps/testapp/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,8 @@ github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
257257
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
258258
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
259259
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
260-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2 h1:jvRM1RT60oRy8jCneGYdX61Y8U2dI9uxjqT87H8uWq4=
261-
github.com/celestiaorg/go-header v0.7.5-0.20260116211018-3f61d145c9d2/go.mod h1:X00prITrMa2kxgEX15WQnbLf0uV6tlvTesDKC5KsDVQ=
260+
github.com/celestiaorg/go-header v0.8.0 h1:j9/t/uhxif26WQ3fULDAh3I55Fh3lJk6qMXPFFuOy28=
261+
github.com/celestiaorg/go-header v0.8.0/go.mod h1:X00prITrMa2kxgEX15WQnbLf0uV6tlvTesDKC5KsDVQ=
262262
github.com/celestiaorg/go-libp2p-messenger v0.2.2 h1:osoUfqjss7vWTIZrrDSy953RjQz+ps/vBFE7bychLEc=
263263
github.com/celestiaorg/go-libp2p-messenger v0.2.2/go.mod h1:oTCRV5TfdO7V/k6nkx7QjQzGrWuJbupv+0o1cgnY2i4=
264264
github.com/celestiaorg/go-square/merkle v0.0.0-20240627094109-7d01436067a3 h1:wP84mtwOCVNOTfS3zErICjxKLnh74Z1uf+tdrlSFjVM=
@@ -618,8 +618,8 @@ github.com/libp2p/go-libp2p v0.46.0 h1:0T2yvIKpZ3DVYCuPOFxPD1layhRU486pj9rSlGWYn
618618
github.com/libp2p/go-libp2p v0.46.0/go.mod h1:TbIDnpDjBLa7isdgYpbxozIVPBTmM/7qKOJP4SFySrQ=
619619
github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94=
620620
github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8=
621-
github.com/libp2p/go-libp2p-kad-dht v0.36.0 h1:7QuXhV36+Vyj+L6A7mrYkn2sYLrbRcbjvsYDu/gXhn8=
622-
github.com/libp2p/go-libp2p-kad-dht v0.36.0/go.mod h1:O24LxTH9Rt3I5XU8nmiA9VynS4TrTwAyj+zBJKB05vQ=
621+
github.com/libp2p/go-libp2p-kad-dht v0.37.0 h1:V1IkFzK9taNS1UNAx260foulcBPH+watAUFjNo2qMUY=
622+
github.com/libp2p/go-libp2p-kad-dht v0.37.0/go.mod h1:o4FPa1ea++UVAMJ1c+kyjUmj3CKm9+ZCyzQb4uutCFM=
623623
github.com/libp2p/go-libp2p-kbucket v0.8.0 h1:QAK7RzKJpYe+EuSEATAaaHYMYLkPDGC18m9jxPLnU8s=
624624
github.com/libp2p/go-libp2p-kbucket v0.8.0/go.mod h1:JMlxqcEyKwO6ox716eyC0hmiduSWZZl6JY93mGaaqc4=
625625
github.com/libp2p/go-libp2p-pubsub v0.15.0 h1:cG7Cng2BT82WttmPFMi50gDNV+58K626m/wR00vGL1o=

block/internal/da/forced_inclusion_retriever.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ import (
1616
// ErrForceInclusionNotConfigured is returned when the forced inclusion namespace is not configured.
1717
var ErrForceInclusionNotConfigured = errors.New("forced inclusion namespace not configured")
1818

19-
// ForcedInclusionRetriever handles retrieval of forced inclusion transactions from DA.
20-
type ForcedInclusionRetriever struct {
19+
// ForcedInclusionRetriever defines the interface for retrieving forced inclusion transactions from DA.
20+
type ForcedInclusionRetriever interface {
21+
RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error)
22+
Stop()
23+
}
24+
25+
// forcedInclusionRetriever handles retrieval of forced inclusion transactions from DA.
26+
type forcedInclusionRetriever struct {
2127
client Client
2228
logger zerolog.Logger
2329
daEpochSize uint64
@@ -40,7 +46,7 @@ func NewForcedInclusionRetriever(
4046
logger zerolog.Logger,
4147
cfg config.Config,
4248
daStartHeight, daEpochSize uint64,
43-
) *ForcedInclusionRetriever {
49+
) ForcedInclusionRetriever {
4450
retrieverLogger := logger.With().Str("component", "forced_inclusion_retriever").Logger()
4551

4652
// Create async block retriever for background prefetching
@@ -54,24 +60,28 @@ func NewForcedInclusionRetriever(
5460
)
5561
asyncFetcher.Start()
5662

57-
return &ForcedInclusionRetriever{
63+
base := &forcedInclusionRetriever{
5864
client: client,
5965
logger: retrieverLogger,
6066
daStartHeight: daStartHeight,
6167
daEpochSize: daEpochSize,
6268
asyncFetcher: asyncFetcher,
6369
}
70+
if cfg.Instrumentation.IsTracingEnabled() {
71+
return withTracingForcedInclusionRetriever(base)
72+
}
73+
return base
6474
}
6575

6676
// Stop stops the background prefetcher.
67-
func (r *ForcedInclusionRetriever) Stop() {
77+
func (r *forcedInclusionRetriever) Stop() {
6878
r.asyncFetcher.Stop()
6979
}
7080

7181
// RetrieveForcedIncludedTxs retrieves forced inclusion transactions at the given DA height.
7282
// It respects epoch boundaries and only fetches at epoch end.
7383
// It tries to get blocks from the async fetcher cache first, then falls back to sync fetching.
74-
func (r *ForcedInclusionRetriever) RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error) {
84+
func (r *forcedInclusionRetriever) RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error) {
7585
// when daStartHeight is not set or no namespace is configured, we retrieve nothing.
7686
if !r.client.HasForcedInclusionNamespace() {
7787
return nil, ErrForceInclusionNotConfigured
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package da
2+
3+
import (
4+
"context"
5+
6+
"go.opentelemetry.io/otel"
7+
"go.opentelemetry.io/otel/attribute"
8+
"go.opentelemetry.io/otel/codes"
9+
"go.opentelemetry.io/otel/trace"
10+
)
11+
12+
var _ ForcedInclusionRetriever = (*tracedForcedInclusionRetriever)(nil)
13+
14+
type tracedForcedInclusionRetriever struct {
15+
inner ForcedInclusionRetriever
16+
tracer trace.Tracer
17+
}
18+
19+
func withTracingForcedInclusionRetriever(inner ForcedInclusionRetriever) ForcedInclusionRetriever {
20+
return &tracedForcedInclusionRetriever{
21+
inner: inner,
22+
tracer: otel.Tracer("ev-node/forced-inclusion"),
23+
}
24+
}
25+
26+
func (t *tracedForcedInclusionRetriever) RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error) {
27+
ctx, span := t.tracer.Start(ctx, "ForcedInclusionRetriever.RetrieveForcedIncludedTxs",
28+
trace.WithAttributes(
29+
attribute.Int64("da.height", int64(daHeight)),
30+
),
31+
)
32+
defer span.End()
33+
34+
event, err := t.inner.RetrieveForcedIncludedTxs(ctx, daHeight)
35+
if err != nil {
36+
span.RecordError(err)
37+
span.SetStatus(codes.Error, err.Error())
38+
return event, err
39+
}
40+
41+
if event != nil {
42+
span.SetAttributes(
43+
attribute.Int64("event.start_da_height", int64(event.StartDaHeight)),
44+
attribute.Int64("event.end_da_height", int64(event.EndDaHeight)),
45+
attribute.Int("event.tx_count", len(event.Txs)),
46+
)
47+
}
48+
49+
return event, nil
50+
}
51+
52+
func (t *tracedForcedInclusionRetriever) Stop() {
53+
t.inner.Stop()
54+
}

block/internal/syncing/syncer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type Syncer struct {
104104

105105
// Handlers
106106
daRetriever DARetriever
107-
fiRetriever *da.ForcedInclusionRetriever
107+
fiRetriever da.ForcedInclusionRetriever
108108
p2pHandler p2pHandler
109109

110110
// Forced inclusion tracking

block/public.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ type ForcedInclusionRetriever interface {
7777

7878
// NewForcedInclusionRetriever creates a new forced inclusion retriever.
7979
// It internally creates and manages an AsyncBlockRetriever for background prefetching.
80+
// Tracing is automatically enabled when configured.
8081
func NewForcedInclusionRetriever(
8182
client DAClient,
8283
cfg config.Config,

0 commit comments

Comments
 (0)