Skip to content

Commit d3265fa

Browse files
committed
oops
1 parent 410b352 commit d3265fa

File tree

5 files changed

+62
-62
lines changed

5 files changed

+62
-62
lines changed

mod/beacon/block_store/service.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ package blockstore
2323
import (
2424
"context"
2525

26-
async "github.com/berachain/beacon-kit/mod/async/pkg/types"
26+
asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
2727
"github.com/berachain/beacon-kit/mod/log"
28-
async1 "github.com/berachain/beacon-kit/mod/primitives/pkg/async"
28+
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
2929
)
3030

3131
// Service is a Service that listens for blocks and stores them in a KVStore.
@@ -38,11 +38,11 @@ type Service[
3838
// logger is used for logging information and errors.
3939
logger log.Logger[any]
4040
// dispatcher is the dispatcher for the service.
41-
dispatcher async.EventDispatcher
41+
dispatcher asynctypes.EventDispatcher
4242
// store is the block store for the service.
4343
store BlockStoreT
4444
// subFinalizedBlkEvents is a channel for receiving finalized block events.
45-
subFinalizedBlkEvents chan async1.Event[BeaconBlockT]
45+
subFinalizedBlkEvents chan async.Event[BeaconBlockT]
4646
}
4747

4848
// NewService creates a new block service.
@@ -52,15 +52,15 @@ func NewService[
5252
](
5353
config Config,
5454
logger log.Logger[any],
55-
dispatcher async.EventDispatcher,
55+
dispatcher asynctypes.EventDispatcher,
5656
store BlockStoreT,
5757
) *Service[BeaconBlockT, BlockStoreT] {
5858
return &Service[BeaconBlockT, BlockStoreT]{
5959
config: config,
6060
logger: logger,
6161
dispatcher: dispatcher,
6262
store: store,
63-
subFinalizedBlkEvents: make(chan async1.Event[BeaconBlockT]),
63+
subFinalizedBlkEvents: make(chan async.Event[BeaconBlockT]),
6464
}
6565
}
6666

@@ -78,7 +78,7 @@ func (s *Service[BeaconBlockT, _]) Start(ctx context.Context) error {
7878

7979
// subscribe a channel to the finalized block events.
8080
if err := s.dispatcher.Subscribe(
81-
async1.BeaconBlockFinalizedEvent, s.subFinalizedBlkEvents,
81+
async.BeaconBlockFinalizedEvent, s.subFinalizedBlkEvents,
8282
); err != nil {
8383
s.logger.Error("failed to subscribe to block events", "error", err)
8484
return err
@@ -102,7 +102,7 @@ func (s *Service[BeaconBlockT, BlockStoreT]) eventLoop(ctx context.Context) {
102102
// onFinalizeBlock is triggered when a finalized block event is received.
103103
// It stores the block in the KVStore.
104104
func (s *Service[BeaconBlockT, _]) onFinalizeBlock(
105-
event async1.Event[BeaconBlockT],
105+
event async.Event[BeaconBlockT],
106106
) {
107107
slot := event.Data().GetSlot()
108108
if err := s.store.Set(event.Data()); err != nil {

mod/beacon/blockchain/service.go

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ import (
2424
"context"
2525
"sync"
2626

27-
async "github.com/berachain/beacon-kit/mod/async/pkg/types"
27+
asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
2828
"github.com/berachain/beacon-kit/mod/log"
29-
async1 "github.com/berachain/beacon-kit/mod/primitives/pkg/async"
29+
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
3030
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
3131
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
3232
)
@@ -57,7 +57,7 @@ type Service[
5757
// chainSpec holds the chain specifications.
5858
chainSpec common.ChainSpec
5959
// dispatcher is the dispatcher for the service.
60-
dispatcher async.Dispatcher
60+
dispatcher asynctypes.Dispatcher
6161
// executionEngine is the execution engine responsible for processing
6262
//
6363
// execution payloads.
@@ -82,12 +82,12 @@ type Service[
8282

8383
// subFinalBlkReceived is a channel for receiving finalize beacon block
8484
// requests.
85-
subFinalBlkReceived chan async1.Event[BeaconBlockT]
85+
subFinalBlkReceived chan async.Event[BeaconBlockT]
8686
// subBlockReceived is a channel for receiving verify beacon block requests.
87-
subBlockReceived chan async1.Event[BeaconBlockT]
87+
subBlockReceived chan async.Event[BeaconBlockT]
8888
// subGenDataReceived is a subscription for receiving genesis data
8989
// received events.
90-
subGenDataReceived chan async1.Event[GenesisT]
90+
subGenDataReceived chan async.Event[GenesisT]
9191
}
9292

9393
// NewService creates a new validator service.
@@ -112,7 +112,7 @@ func NewService[
112112
],
113113
logger log.Logger[any],
114114
chainSpec common.ChainSpec,
115-
dispatcher async.Dispatcher,
115+
dispatcher asynctypes.Dispatcher,
116116
executionEngine ExecutionEngine[PayloadAttributesT],
117117
localBuilder LocalBuilder[BeaconStateT],
118118
stateProcessor StateProcessor[
@@ -144,9 +144,9 @@ func NewService[
144144
metrics: newChainMetrics(telemetrySink),
145145
optimisticPayloadBuilds: optimisticPayloadBuilds,
146146
forceStartupSyncOnce: new(sync.Once),
147-
subFinalBlkReceived: make(chan async1.Event[BeaconBlockT]),
148-
subBlockReceived: make(chan async1.Event[BeaconBlockT]),
149-
subGenDataReceived: make(chan async1.Event[GenesisT]),
147+
subFinalBlkReceived: make(chan async.Event[BeaconBlockT]),
148+
subBlockReceived: make(chan async.Event[BeaconBlockT]),
149+
subGenDataReceived: make(chan async.Event[GenesisT]),
150150
}
151151
}
152152

@@ -164,19 +164,19 @@ func (s *Service[
164164
_, BeaconBlockT, _, _, _, _, _, _, GenesisT, _,
165165
]) Start(ctx context.Context) error {
166166
if err := s.dispatcher.Subscribe(
167-
async1.GenesisDataReceived, s.subGenDataReceived,
167+
async.GenesisDataReceived, s.subGenDataReceived,
168168
); err != nil {
169169
return err
170170
}
171171

172172
if err := s.dispatcher.Subscribe(
173-
async1.BeaconBlockReceived, s.subBlockReceived,
173+
async.BeaconBlockReceived, s.subBlockReceived,
174174
); err != nil {
175175
return err
176176
}
177177

178178
if err := s.dispatcher.Subscribe(
179-
async1.FinalBeaconBlockReceived, s.subFinalBlkReceived,
179+
async.FinalBeaconBlockReceived, s.subFinalBlkReceived,
180180
); err != nil {
181181
return err
182182
}
@@ -210,7 +210,7 @@ func (s *Service[
210210

211211
func (s *Service[
212212
_, _, _, _, _, _, _, _, GenesisT, _,
213-
]) handleGenDataReceived(msg async1.Event[GenesisT]) {
213+
]) handleGenDataReceived(msg async.Event[GenesisT]) {
214214
var (
215215
valUpdates transition.ValidatorUpdates
216216
genesisErr error
@@ -227,9 +227,9 @@ func (s *Service[
227227

228228
// Emit the event containing the validator updates.
229229
if err := s.dispatcher.Publish(
230-
async1.NewEvent(
230+
async.NewEvent(
231231
msg.Context(),
232-
async1.GenesisDataProcessed,
232+
async.GenesisDataProcessed,
233233
valUpdates,
234234
genesisErr,
235235
),
@@ -245,7 +245,7 @@ func (s *Service[
245245
func (s *Service[
246246
_, BeaconBlockT, _, _, _, _, _, _, _, _,
247247
]) handleBeaconBlockReceived(
248-
msg async1.Event[BeaconBlockT],
248+
msg async.Event[BeaconBlockT],
249249
) {
250250
// If the block is nil, exit early.
251251
if msg.Error() != nil {
@@ -256,9 +256,9 @@ func (s *Service[
256256
// emit a BeaconBlockVerified event with the error result from \
257257
// VerifyIncomingBlock
258258
if err := s.dispatcher.Publish(
259-
async1.NewEvent(
259+
async.NewEvent(
260260
msg.Context(),
261-
async1.BeaconBlockVerified,
261+
async.BeaconBlockVerified,
262262
msg.Data(),
263263
s.VerifyIncomingBlock(msg.Context(), msg.Data()),
264264
),
@@ -273,7 +273,7 @@ func (s *Service[
273273
func (s *Service[
274274
_, BeaconBlockT, _, _, _, _, _, _, _, _,
275275
]) handleBeaconBlockFinalization(
276-
msg async1.Event[BeaconBlockT],
276+
msg async.Event[BeaconBlockT],
277277
) {
278278
var (
279279
valUpdates transition.ValidatorUpdates
@@ -295,9 +295,9 @@ func (s *Service[
295295

296296
// Emit the event containing the validator updates.
297297
if err := s.dispatcher.Publish(
298-
async1.NewEvent(
298+
async.NewEvent(
299299
msg.Context(),
300-
async1.FinalValidatorUpdatesProcessed,
300+
async.FinalValidatorUpdatesProcessed,
301301
valUpdates,
302302
finalizeErr,
303303
),

mod/beacon/validator/service.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ package validator
2323
import (
2424
"context"
2525

26-
async "github.com/berachain/beacon-kit/mod/async/pkg/types"
26+
asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
2727
"github.com/berachain/beacon-kit/mod/log"
28-
async1 "github.com/berachain/beacon-kit/mod/primitives/pkg/async"
28+
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
2929
"github.com/berachain/beacon-kit/mod/primitives/pkg/common"
3030
"github.com/berachain/beacon-kit/mod/primitives/pkg/crypto"
3131
"github.com/berachain/beacon-kit/mod/primitives/pkg/transition"
@@ -62,7 +62,7 @@ type Service[
6262
// sb is the beacon state backend.
6363
sb StorageBackend[BeaconStateT, DepositStoreT]
6464
// dispatcher is the dispatcher.
65-
dispatcher async.EventDispatcher
65+
dispatcher asynctypes.EventDispatcher
6666
// stateProcessor is responsible for processing the state.
6767
stateProcessor StateProcessor[
6868
BeaconBlockT,
@@ -81,7 +81,7 @@ type Service[
8181
// metrics is a metrics collector.
8282
metrics *validatorMetrics
8383
// subNewSlot is a channel for new slot events.
84-
subNewSlot chan async1.Event[SlotDataT]
84+
subNewSlot chan async.Event[SlotDataT]
8585
}
8686

8787
// NewService creates a new validator service.
@@ -117,7 +117,7 @@ func NewService[
117117
localPayloadBuilder PayloadBuilder[BeaconStateT, ExecutionPayloadT],
118118
remotePayloadBuilders []PayloadBuilder[BeaconStateT, ExecutionPayloadT],
119119
ts TelemetrySink,
120-
dispatcher async.EventDispatcher,
120+
dispatcher asynctypes.EventDispatcher,
121121
) *Service[
122122
AttestationDataT, BeaconBlockT, BeaconBlockBodyT, BeaconStateT,
123123
BlobSidecarsT, DepositT, DepositStoreT, Eth1DataT, ExecutionPayloadT,
@@ -140,7 +140,7 @@ func NewService[
140140
remotePayloadBuilders: remotePayloadBuilders,
141141
metrics: newValidatorMetrics(ts),
142142
dispatcher: dispatcher,
143-
subNewSlot: make(chan async1.Event[SlotDataT]),
143+
subNewSlot: make(chan async.Event[SlotDataT]),
144144
}
145145
}
146146

@@ -159,7 +159,7 @@ func (s *Service[
159159
ctx context.Context,
160160
) error {
161161
// subscribe to new slot events
162-
err := s.dispatcher.Subscribe(async1.NewSlot, s.subNewSlot)
162+
err := s.dispatcher.Subscribe(async.NewSlot, s.subNewSlot)
163163
if err != nil {
164164
return err
165165
}
@@ -185,7 +185,7 @@ func (s *Service[_, _, _, _, _, _, _, _, _, _, _, _, SlotDataT]) eventLoop(
185185
// slot data and emits an event containing the built block and sidecars.
186186
func (s *Service[
187187
_, BeaconBlockT, _, _, BlobSidecarsT, _, _, _, _, _, _, _, SlotDataT,
188-
]) handleNewSlot(req async1.Event[SlotDataT]) {
188+
]) handleNewSlot(req async.Event[SlotDataT]) {
189189
var (
190190
blk BeaconBlockT
191191
sidecars BlobSidecarsT
@@ -201,14 +201,14 @@ func (s *Service[
201201

202202
// emit a built block event with the built block and the error
203203
if bbErr := s.dispatcher.Publish(
204-
async1.NewEvent(req.Context(), async1.BuiltBeaconBlock, blk, err),
204+
async.NewEvent(req.Context(), async.BuiltBeaconBlock, blk, err),
205205
); bbErr != nil {
206206
s.logger.Error("failed to dispatch built block", "err", err)
207207
}
208208

209209
// emit a built sidecars event with the built sidecars and the error
210210
if scErr := s.dispatcher.Publish(
211-
async1.NewEvent(req.Context(), async1.BuiltSidecars, sidecars, err),
211+
async.NewEvent(req.Context(), async.BuiltSidecars, sidecars, err),
212212
); scErr != nil {
213213
s.logger.Error("failed to dispatch built sidecars", "err", err)
214214
}

mod/da/pkg/da/service.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ package da
2323
import (
2424
"context"
2525

26-
async "github.com/berachain/beacon-kit/mod/async/pkg/types"
26+
asynctypes "github.com/berachain/beacon-kit/mod/async/pkg/types"
2727
"github.com/berachain/beacon-kit/mod/log"
28-
async1 "github.com/berachain/beacon-kit/mod/primitives/pkg/async"
28+
"github.com/berachain/beacon-kit/mod/primitives/pkg/async"
2929
)
3030

3131
// The Data Availability service is responsible for verifying and processing
@@ -41,10 +41,10 @@ type Service[
4141
AvailabilityStoreT,
4242
BlobSidecarsT,
4343
]
44-
dispatcher async.EventDispatcher
44+
dispatcher asynctypes.EventDispatcher
4545
logger log.Logger[any]
46-
subSidecarsReceived chan async1.Event[BlobSidecarsT]
47-
subFinalBlobSidecars chan async1.Event[BlobSidecarsT]
46+
subSidecarsReceived chan async.Event[BlobSidecarsT]
47+
subFinalBlobSidecars chan async.Event[BlobSidecarsT]
4848
}
4949

5050
// NewService returns a new DA service.
@@ -56,7 +56,7 @@ func NewService[
5656
bp BlobProcessor[
5757
AvailabilityStoreT, BlobSidecarsT,
5858
],
59-
dispatcher async.EventDispatcher,
59+
dispatcher asynctypes.EventDispatcher,
6060
logger log.Logger[any],
6161
) *Service[
6262
AvailabilityStoreT, BlobSidecarsT,
@@ -68,8 +68,8 @@ func NewService[
6868
bp: bp,
6969
dispatcher: dispatcher,
7070
logger: logger,
71-
subSidecarsReceived: make(chan async1.Event[BlobSidecarsT]),
72-
subFinalBlobSidecars: make(chan async1.Event[BlobSidecarsT]),
71+
subSidecarsReceived: make(chan async.Event[BlobSidecarsT]),
72+
subFinalBlobSidecars: make(chan async.Event[BlobSidecarsT]),
7373
}
7474
}
7575

@@ -85,14 +85,14 @@ func (s *Service[_, BlobSidecarsT]) Start(ctx context.Context) error {
8585

8686
// subscribe to SidecarsReceived events
8787
if err = s.dispatcher.Subscribe(
88-
async1.SidecarsReceived, s.subSidecarsReceived,
88+
async.SidecarsReceived, s.subSidecarsReceived,
8989
); err != nil {
9090
return err
9191
}
9292

9393
// subscribe to FinalSidecarsReceived events
9494
if err = s.dispatcher.Subscribe(
95-
async1.FinalSidecarsReceived, s.subFinalBlobSidecars,
95+
async.FinalSidecarsReceived, s.subFinalBlobSidecars,
9696
); err != nil {
9797
return err
9898
}
@@ -123,7 +123,7 @@ func (s *Service[_, BlobSidecarsT]) eventLoop(ctx context.Context) {
123123
// event.
124124
// It processes the sidecars and publishes a BlobSidecarsProcessed event.
125125
func (s *Service[_, BlobSidecarsT]) handleFinalSidecarsReceived(
126-
msg async1.Event[BlobSidecarsT],
126+
msg async.Event[BlobSidecarsT],
127127
) {
128128
if err := s.processSidecars(msg.Context(), msg.Data()); err != nil {
129129
s.logger.Error(
@@ -137,7 +137,7 @@ func (s *Service[_, BlobSidecarsT]) handleFinalSidecarsReceived(
137137
// handleSidecarsReceived handles the SidecarsVerifyRequest event.
138138
// It verifies the sidecars and publishes a SidecarsVerified event.
139139
func (s *Service[_, BlobSidecarsT]) handleSidecarsReceived(
140-
msg async1.Event[BlobSidecarsT],
140+
msg async.Event[BlobSidecarsT],
141141
) {
142142
var sidecarsErr error
143143
// verify the sidecars.
@@ -151,8 +151,8 @@ func (s *Service[_, BlobSidecarsT]) handleSidecarsReceived(
151151

152152
// emit the sidecars verification event with error from verifySidecars
153153
if err := s.dispatcher.Publish(
154-
async1.NewEvent(
155-
msg.Context(), async1.SidecarsVerified, msg.Data(), sidecarsErr,
154+
async.NewEvent(
155+
msg.Context(), async.SidecarsVerified, msg.Data(), sidecarsErr,
156156
),
157157
); err != nil {
158158
s.logger.Error("failed to publish event", "err", err)

0 commit comments

Comments
 (0)