Skip to content

Commit f791038

Browse files
committed
chore: simplified naming
1 parent 0afb107 commit f791038

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

block/internal/da/forced_inclusion_retriever.go

Lines changed: 12 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-
) ForcedInclusionRetrieverAPI {
49+
) ForcedInclusionRetriever {
4450
retrieverLogger := logger.With().Str("component", "forced_inclusion_retriever").Logger()
4551

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

57-
base := &ForcedInclusionRetriever{
63+
base := &forcedInclusionRetriever{
5864
client: client,
5965
logger: retrieverLogger,
6066
daStartHeight: daStartHeight,
@@ -68,14 +74,14 @@ func NewForcedInclusionRetriever(
6874
}
6975

7076
// Stop stops the background prefetcher.
71-
func (r *ForcedInclusionRetriever) Stop() {
77+
func (r *forcedInclusionRetriever) Stop() {
7278
r.asyncFetcher.Stop()
7379
}
7480

7581
// RetrieveForcedIncludedTxs retrieves forced inclusion transactions at the given DA height.
7682
// It respects epoch boundaries and only fetches at epoch end.
7783
// It tries to get blocks from the async fetcher cache first, then falls back to sync fetching.
78-
func (r *ForcedInclusionRetriever) RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error) {
84+
func (r *forcedInclusionRetriever) RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error) {
7985
// when daStartHeight is not set or no namespace is configured, we retrieve nothing.
8086
if !r.client.HasForcedInclusionNamespace() {
8187
return nil, ErrForceInclusionNotConfigured

block/internal/da/forced_inclusion_tracing.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,14 @@ import (
99
"go.opentelemetry.io/otel/trace"
1010
)
1111

12-
// ForcedInclusionRetrieverAPI defines the interface for retrieving forced inclusion transactions from DA.
13-
type ForcedInclusionRetrieverAPI interface {
14-
RetrieveForcedIncludedTxs(ctx context.Context, daHeight uint64) (*ForcedInclusionEvent, error)
15-
Stop()
16-
}
17-
18-
var _ ForcedInclusionRetrieverAPI = (*tracedForcedInclusionRetriever)(nil)
12+
var _ ForcedInclusionRetriever = (*tracedForcedInclusionRetriever)(nil)
1913

2014
type tracedForcedInclusionRetriever struct {
21-
inner ForcedInclusionRetrieverAPI
15+
inner ForcedInclusionRetriever
2216
tracer trace.Tracer
2317
}
2418

25-
func withTracingForcedInclusionRetriever(inner ForcedInclusionRetrieverAPI) ForcedInclusionRetrieverAPI {
19+
func withTracingForcedInclusionRetriever(inner ForcedInclusionRetriever) ForcedInclusionRetriever {
2620
return &tracedForcedInclusionRetriever{
2721
inner: inner,
2822
tracer: otel.Tracer("ev-node/forced-inclusion"),

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.ForcedInclusionRetrieverAPI
107+
fiRetriever da.ForcedInclusionRetriever
108108
p2pHandler p2pHandler
109109

110110
// Forced inclusion tracking

0 commit comments

Comments
 (0)