Skip to content

Commit d5628b5

Browse files
authored
Merge pull request ethereum#25 from astriaorg/bharath/add-auctioneer-metrics
feat: Trusted Auctioneer: Add initial set of metrics for auctioneer
2 parents b6e5401 + 5b99a85 commit d5628b5

File tree

10 files changed

+232
-136
lines changed

10 files changed

+232
-136
lines changed

.github/workflows/astria-build-and-publish-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,4 @@ jobs:
7272
push: true
7373
tags: ${{ steps.metadata.outputs.tags }}
7474
labels: ${{ steps.metadata.outputs.labels }}
75-
project: w2d6w0spqz
75+
project: w2d6w0spqz

cmd/utils/flags.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
package utils
1919

2020
import (
21-
optimisticGrpc "buf.build/gen/go/astria/execution-apis/grpc/go/astria/bundle/v1alpha1/bundlev1alpha1grpc"
21+
optimisticGrpc "buf.build/gen/go/astria/execution-apis/grpc/go/astria/auction/v1alpha1/auctionv1alpha1grpc"
2222
"context"
2323
"crypto/ecdsa"
2424
"encoding/hex"
@@ -2003,8 +2003,8 @@ func RegisterGraphQLService(stack *node.Node, backend ethapi.Backend, filterSyst
20032003

20042004
// RegisterGRPCServices adds the gRPC API to the node.
20052005
// It was done this way so that our grpc execution server can access the ethapi.Backend
2006-
func RegisterGRPCServices(stack *node.Node, execServ astriaGrpc.ExecutionServiceServer, optimisticExecutionServ optimisticGrpc.OptimisticExecutionServiceServer, bundleStreamingServ optimisticGrpc.BundleServiceServer, cfg *node.Config) {
2007-
if err := node.NewGRPCServerHandler(stack, execServ, optimisticExecutionServ, bundleStreamingServ, cfg); err != nil {
2006+
func RegisterGRPCServices(stack *node.Node, execServ astriaGrpc.ExecutionServiceServer, optimisticExecutionServ optimisticGrpc.OptimisticExecutionServiceServer, auctionServiceServer optimisticGrpc.AuctionServiceServer, cfg *node.Config) {
2007+
if err := node.NewGRPCServerHandler(stack, execServ, optimisticExecutionServ, auctionServiceServer, cfg); err != nil {
20082008
Fatalf("Failed to register the gRPC service: %v", err)
20092009
}
20102010
}

go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ module github.com/ethereum/go-ethereum
33
go 1.21
44

55
require (
6-
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-e09c7fd3fe26.1
7-
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.35.2-00000000000000-e09c7fd3fe26.1
8-
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.35.2-00000000000000-2f2e9ce53f59.1
9-
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.35.2-00000000000000-0eda7df0ee38.1
6+
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-42cbdd5aad4c.2
7+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.2-00000000000000-42cbdd5aad4c.1
8+
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.36.2-00000000000000-9a039a6ed8db.1
9+
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.36.2-00000000000000-e54e1c9ad405.1
1010
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0
1111
github.com/Microsoft/go-winio v0.6.1
1212
github.com/VictoriaMetrics/fastcache v1.12.1
@@ -79,7 +79,7 @@ require (
7979
golang.org/x/time v0.5.0
8080
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d
8181
google.golang.org/grpc v1.64.1
82-
google.golang.org/protobuf v1.35.2
82+
google.golang.org/protobuf v1.36.2
8383
gopkg.in/natefinch/lumberjack.v2 v2.0.0
8484
gopkg.in/yaml.v3 v3.0.1
8585
)

go.sum

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-1f40f333891d.2 h1:9rMXnvPR2EX56tMIqbhOK+DvqKjWb++p5s1/bookIl8=
2+
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-1f40f333891d.2/go.mod h1:hdCXwnxpMeoqXK5LCQ6gLMcmMLUDX8T9+hbxYrtj+wQ=
3+
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-42cbdd5aad4c.2 h1:W0lzc0sAzlzyKWWXLcuGW+GDsB9VRT+P/4ffP/hwJ4U=
4+
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-42cbdd5aad4c.2/go.mod h1:jXiXYlSxLrhrUCAIuLq4cVcfXydbsz9mRVftWx/8eGs=
15
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-cc31a327d543.1 h1:wOry49zAbse0G4mt2tFTwa4P2AUMuYCR/0mYcPrpcbs=
26
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-cc31a327d543.1/go.mod h1:+pVCkEpJNp2JtooS8NiydT7bO9+hu11XUZ5Z47DPtXo=
37
buf.build/gen/go/astria/execution-apis/grpc/go v1.5.1-00000000000000-e09c7fd3fe26.1 h1:gS4erruX5XeMN0MZ7xe4JmEIR3uCWrvzG5HGV725WiI=
@@ -10,14 +14,28 @@ buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.35.1-20241017141511
1014
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.35.1-20241017141511-7e4bcc0ebba5.1/go.mod h1:U4LUlabiYNYBd1pqYS9o8SsHjBRoEBysrfRVnebzJH0=
1115
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.35.2-00000000000000-e09c7fd3fe26.1 h1:Twi169wrd7ssCnK27Bymlytv5LmvwFV0zhKhJ64nCYM=
1216
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.35.2-00000000000000-e09c7fd3fe26.1/go.mod h1:PWzMbPHJ+Y31iNFrtSc5vy/wvm2805ZXyDZndzzFLa0=
17+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.1-00000000000000-1f40f333891d.1 h1:CSMft5/33d/88j3ziC4zid4DOP7X1Xv71I6pW3BUOvA=
18+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.1-00000000000000-1f40f333891d.1/go.mod h1:7azHjtjY3sk38xuZGlf2X6DpAPgQMoeZZMix+JkqsdU=
19+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.2-00000000000000-1f40f333891d.1 h1:cRvRFDg3/KPgEB2+8/orNwCWBhZO0wVZKij4TTKBj9w=
20+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.2-00000000000000-1f40f333891d.1/go.mod h1:oB3M+Fq9RgyUWGMqYk2FqRobQpdH1yZQZ9TYOoc4yIw=
21+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.2-00000000000000-42cbdd5aad4c.1 h1:GnqNuwC6UjXvtjGscDekiO+/lstY7NWOILlsOMGNpC4=
22+
buf.build/gen/go/astria/execution-apis/protocolbuffers/go v1.36.2-00000000000000-42cbdd5aad4c.1/go.mod h1:oB3M+Fq9RgyUWGMqYk2FqRobQpdH1yZQZ9TYOoc4yIw=
1323
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.35.1-20240911152449-eeebd3decdce.1 h1:kG4riHqlF9X6iZ1Oxs5/6ul6aue7MS+A6DK6HAchuTk=
1424
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.35.1-20240911152449-eeebd3decdce.1/go.mod h1:n9L7X3VAj4od4VHf2ScJuHARUUQTSxJqtRHZk/7Ptt0=
1525
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.35.2-00000000000000-2f2e9ce53f59.1 h1:C1bT0G1In6Z6tBERd1XqwDjdxTK+PatSOJYlVk5Is60=
1626
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.35.2-00000000000000-2f2e9ce53f59.1/go.mod h1:I9FcB1oNqT1nI+ny0GD8gF9YrIYrHmczgNu6MTE9fAo=
27+
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.36.1-00000000000000-9a039a6ed8db.1 h1:v+RKpd5zE6rqOMA44OLRpDLPYlakjmddvmFFrKxzb48=
28+
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.36.1-00000000000000-9a039a6ed8db.1/go.mod h1:HnX2FkSKZuD3zPFBR+Q17WzloqvIbFd0pYE++or/x2Q=
29+
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.36.2-00000000000000-9a039a6ed8db.1 h1:inT/lOAbHunpGP9YLqtAQNssrxEIgH/OmxXNwbXjUqs=
30+
buf.build/gen/go/astria/primitives/protocolbuffers/go v1.36.2-00000000000000-9a039a6ed8db.1/go.mod h1:Lk1TBSGhOGvbtj0lb7eTeq+Z4N86/67Ay+WWxbqhh6s=
1731
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.35.1-20241017141511-71aab1871615.1 h1:hPMoxTiT7jJjnIbWqneBbL05VeVOTD9UeC/qdvzHL8g=
1832
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.35.1-20241017141511-71aab1871615.1/go.mod h1:2uasRFMH+a3DaF34c1o+w7/YtYnoknmARyYpb9W2QIc=
1933
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.35.2-00000000000000-0eda7df0ee38.1 h1:uJm/22xugluY5AL2NkIDbNEFBxzN6UcI8vts/bGEDBs=
2034
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.35.2-00000000000000-0eda7df0ee38.1/go.mod h1:1Z9P18WNTOT+KvLlc0+2FkcBJ7l5eRUUFcnOxHmLeRA=
35+
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.36.1-00000000000000-e54e1c9ad405.1 h1:querphz/TCGphT0qGG4DJo6p8qAsfL5/8SEBgfemVhk=
36+
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.36.1-00000000000000-e54e1c9ad405.1/go.mod h1:D6ou7OxkQXmiZDDNNrT147dA9wC9rhJPchCIfVbw9wM=
37+
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.36.2-00000000000000-e54e1c9ad405.1 h1:n2embOKwJS+YIyjHRDvOAo7c/kuv3fw9U+gQ/g2Yis8=
38+
buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go v1.36.2-00000000000000-e54e1c9ad405.1/go.mod h1:dHPKfn7RW6FSo7EkD0LqPhZUmRm5NXMB+tWvTrTnZTQ=
2139
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
2240
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
2341
cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
@@ -923,6 +941,10 @@ google.golang.org/protobuf v1.35.1 h1:m3LfL6/Ca+fqnjnlqQXNpFPABW1UD7mjh8KO2mKFyt
923941
google.golang.org/protobuf v1.35.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
924942
google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io=
925943
google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
944+
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
945+
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
946+
google.golang.org/protobuf v1.36.2 h1:R8FeyR1/eLmkutZOM5CWghmo5itiG9z0ktFlTVLuTmU=
947+
google.golang.org/protobuf v1.36.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
926948
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
927949
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
928950
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

grpc/optimistic/server.go

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package optimistic
22

33
import (
4-
optimisticGrpc "buf.build/gen/go/astria/execution-apis/grpc/go/astria/bundle/v1alpha1/bundlev1alpha1grpc"
5-
optimsticPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/bundle/v1alpha1"
4+
optimisticGrpc "buf.build/gen/go/astria/execution-apis/grpc/go/astria/auction/v1alpha1/auctionv1alpha1grpc"
5+
optimsticPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/auction/v1alpha1"
66
astriaPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/execution/v1"
77
"context"
88
"errors"
@@ -28,7 +28,7 @@ import (
2828

2929
type OptimisticServiceV1Alpha1 struct {
3030
optimisticGrpc.UnimplementedOptimisticExecutionServiceServer
31-
optimisticGrpc.UnimplementedBundleServiceServer
31+
optimisticGrpc.UnimplementedAuctionServiceServer
3232

3333
sharedServiceContainer *shared.SharedServiceContainer
3434

@@ -38,6 +38,8 @@ type OptimisticServiceV1Alpha1 struct {
3838
var (
3939
executeOptimisticBlockRequestCount = metrics.GetOrRegisterCounter("astria/optimistic/execute_optimistic_block_requests", nil)
4040
executeOptimisticBlockSuccessCount = metrics.GetOrRegisterCounter("astria/optimistic/execute_optimistic_block_success", nil)
41+
optimisticBlockHeight = metrics.GetOrRegisterGauge("astria/execution/optimistic_block_height", nil)
42+
txsStreamedCount = metrics.GetOrRegisterCounter("astria/optimistic/txs_streamed", nil)
4143

4244
executionOptimisticBlockTimer = metrics.GetOrRegisterTimer("astria/optimistic/execute_optimistic_block_time", nil)
4345
)
@@ -52,8 +54,8 @@ func NewOptimisticServiceV1Alpha(sharedServiceContainer *shared.SharedServiceCon
5254
return optimisticService
5355
}
5456

55-
func (o *OptimisticServiceV1Alpha1) GetBundleStream(_ *optimsticPb.GetBundleStreamRequest, stream optimisticGrpc.BundleService_GetBundleStreamServer) error {
56-
log.Debug("GetBundleStream called")
57+
func (o *OptimisticServiceV1Alpha1) GetBidStream(_ *optimsticPb.GetBidStreamRequest, stream optimisticGrpc.AuctionService_GetBidStreamServer) error {
58+
log.Debug("GetBidStream called")
5759

5860
pendingTxEventCh := make(chan core.NewTxsEvent)
5961
pendingTxEvent := o.Eth().TxPool().SubscribeTransactions(pendingTxEventCh, false)
@@ -67,7 +69,7 @@ func (o *OptimisticServiceV1Alpha1) GetBundleStream(_ *optimsticPb.GetBundleStre
6769
optimisticBlock := o.Eth().BlockChain().CurrentOptimisticBlock()
6870

6971
for _, pendingTx := range pendingTxs.Txs {
70-
bundle := optimsticPb.Bundle{}
72+
bid := optimsticPb.Bid{}
7173

7274
totalCost := big.NewInt(0)
7375
effectiveTip := cmath.BigMin(pendingTx.GasTipCap(), new(big.Int).Sub(pendingTx.GasFeeCap(), optimisticBlock.BaseFee))
@@ -80,15 +82,16 @@ func (o *OptimisticServiceV1Alpha1) GetBundleStream(_ *optimsticPb.GetBundleStre
8082
}
8183
marshalledTxs = append(marshalledTxs, marshalledTx)
8284

83-
bundle.Fee = totalCost.Uint64()
84-
bundle.Transactions = marshalledTxs
85-
bundle.BaseSequencerBlockHash = *o.currentOptimisticSequencerBlock.Load()
86-
bundle.PrevRollupBlockHash = optimisticBlock.Hash().Bytes()
85+
bid.Fee = totalCost.Uint64()
86+
bid.Transactions = marshalledTxs
87+
bid.SequencerParentBlockHash = *o.currentOptimisticSequencerBlock.Load()
88+
bid.RollupParentBlockHash = optimisticBlock.Hash().Bytes()
8789

88-
err = stream.Send(&optimsticPb.GetBundleStreamResponse{Bundle: &bundle})
90+
txsStreamedCount.Inc(1)
91+
err = stream.Send(&optimsticPb.GetBidStreamResponse{Bid: &bid})
8992
if err != nil {
90-
log.Error("error sending bundle over stream", "err", err)
91-
return status.Error(codes.Internal, shared.WrapError(err, "error sending bundle over stream").Error())
93+
log.Error("error sending bid over stream", "err", err)
94+
return status.Error(codes.Internal, shared.WrapError(err, "error sending bid over stream").Error())
9295
}
9396
}
9497

@@ -124,6 +127,8 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlockStream(stream optimist
124127
return err
125128
}
126129

130+
executeOptimisticBlockRequestCount.Inc(1)
131+
127132
baseBlock := msg.GetBaseBlock()
128133

129134
// execute the optimistic block and wait for the mempool clearing event
@@ -140,6 +145,7 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlockStream(stream optimist
140145
return status.Error(codes.Internal, "failed to clear mempool after optimistic block execution")
141146
}
142147
o.currentOptimisticSequencerBlock.Store(&baseBlock.SequencerBlockHash)
148+
executeOptimisticBlockSuccessCount.Inc(1)
143149
err = stream.Send(&optimsticPb.ExecuteOptimisticBlockStreamResponse{
144150
Block: optimisticBlock,
145151
BaseSequencerBlockHash: baseBlock.SequencerBlockHash,
@@ -164,7 +170,10 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlockStream(stream optimist
164170
func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlock(ctx context.Context, req *optimsticPb.BaseBlock) (*astriaPb.Block, error) {
165171
// we need to execute the optimistic block
166172
log.Debug("ExecuteOptimisticBlock called", "timestamp", req.Timestamp, "sequencer_block_hash", req.SequencerBlockHash)
167-
executeOptimisticBlockRequestCount.Inc(1)
173+
174+
// Deliberately called after lock, to more directly measure the time spent executing
175+
executionStart := time.Now()
176+
defer executionOptimisticBlockTimer.UpdateSince(executionStart)
168177

169178
if err := validateStaticExecuteOptimisticBlockRequest(req); err != nil {
170179
log.Error("ExecuteOptimisticBlock called with invalid BaseBlock", "err", err)
@@ -175,10 +184,6 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlock(ctx context.Context,
175184
return nil, status.Error(codes.PermissionDenied, "Cannot execute block until GetGenesisInfo && GetCommitmentState methods are called")
176185
}
177186

178-
// Deliberately called after lock, to more directly measure the time spent executing
179-
executionStart := time.Now()
180-
defer executionOptimisticBlockTimer.UpdateSince(executionStart)
181-
182187
softBlock := o.Bc().CurrentSafeBlock()
183188

184189
nextFeeRecipient := o.NextFeeRecipient()
@@ -234,8 +239,9 @@ func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlock(ctx context.Context,
234239
},
235240
}
236241

242+
optimisticBlockHeight.Update(int64(block.NumberU64()))
243+
237244
log.Info("ExecuteOptimisticBlock completed", "block_num", res.Number, "timestamp", res.Timestamp)
238-
executeOptimisticBlockSuccessCount.Inc(1)
239245

240246
return res, nil
241247
}

grpc/optimistic/server_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package optimistic
22

33
import (
4-
optimsticPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/bundle/v1alpha1"
4+
optimsticPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/auction/v1alpha1"
55
astriaPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/execution/v1"
66
primitivev1 "buf.build/gen/go/astria/primitives/protocolbuffers/go/astria/primitive/v1"
77
sequencerblockv1 "buf.build/gen/go/astria/sequencerblock-apis/protocolbuffers/go/astria/sequencerblock/v1"
@@ -193,7 +193,7 @@ func TestOptimisticServiceServerV1Alpha1_ExecuteOptimisticBlock(t *testing.T) {
193193
}
194194
}
195195

196-
func TestNewOptimisticServiceServerV1Alpha_StreamBundles(t *testing.T) {
196+
func TestNewOptimisticServiceServerV1Alpha_StreamBids(t *testing.T) {
197197
ethservice, sharedService, _, _ := shared.SetupSharedService(t, 10)
198198

199199
optimisticServiceV1Alpha1 := SetupOptimisticService(t, sharedService)
@@ -286,13 +286,13 @@ func TestNewOptimisticServiceServerV1Alpha_StreamBundles(t *testing.T) {
286286
require.Equal(t, pending, 0, "Mempool should have 0 pending txs")
287287
require.Equal(t, queued, 0, "Mempool should have 0 queued txs")
288288

289-
mockServerSideStreaming := MockServerSideStreaming[optimsticPb.GetBundleStreamResponse]{
290-
sentResponses: []*optimsticPb.GetBundleStreamResponse{},
289+
mockServerSideStreaming := MockServerSideStreaming[optimsticPb.GetBidStreamResponse]{
290+
sentResponses: []*optimsticPb.GetBidStreamResponse{},
291291
}
292292

293293
errorCh = make(chan error)
294294
go func() {
295-
errorCh <- optimisticServiceV1Alpha1.GetBundleStream(&optimsticPb.GetBundleStreamRequest{}, &mockServerSideStreaming)
295+
errorCh <- optimisticServiceV1Alpha1.GetBidStream(&optimsticPb.GetBidStreamRequest{}, &mockServerSideStreaming)
296296
}()
297297

298298
stateDb, err := ethservice.BlockChain().StateAt(currentOptimisticBlock.Root)
@@ -341,19 +341,19 @@ func TestNewOptimisticServiceServerV1Alpha_StreamBundles(t *testing.T) {
341341

342342
txIndx := 0
343343
for _, resp := range mockServerSideStreaming.sentResponses {
344-
bundle := resp.GetBundle()
344+
bid := resp.GetBid()
345345

346-
require.Len(t, bundle.Transactions, 1, "Bundle should have 1 tx")
346+
require.Len(t, bid.Transactions, 1, "Bid should have 1 tx")
347347

348-
receivedTx := bundle.Transactions[0]
348+
receivedTx := bid.Transactions[0]
349349
sentTx := txs[txIndx]
350350
marshalledSentTx, err := sentTx.MarshalBinary()
351351
require.Nil(t, err, "Failed to marshal tx")
352352
require.True(t, bytes.Equal(receivedTx, marshalledSentTx), "Received tx does not match sent tx")
353353
txIndx += 1
354354

355-
require.True(t, bytes.Equal(bundle.PrevRollupBlockHash, currentOptimisticBlock.Hash().Bytes()), "PrevRollupBlockHash should match the current optimistic block hash")
356-
require.True(t, bytes.Equal(bundle.BaseSequencerBlockHash, *optimisticServiceV1Alpha1.currentOptimisticSequencerBlock.Load()), "BaseSequencerBlockHash should match the current optimistic sequencer block hash")
355+
require.True(t, bytes.Equal(bid.RollupParentBlockHash, currentOptimisticBlock.Hash().Bytes()), "PrevRollupBlockHash should match the current optimistic block hash")
356+
require.True(t, bytes.Equal(bid.SequencerParentBlockHash, *optimisticServiceV1Alpha1.currentOptimisticSequencerBlock.Load()), "BaseSequencerBlockHash should match the current optimistic sequencer block hash")
357357
}
358358
}
359359

grpc/optimistic/validation.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package optimistic
22

33
import (
4-
optimsticPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/bundle/v1alpha1"
4+
optimsticPb "buf.build/gen/go/astria/execution-apis/protocolbuffers/go/astria/auction/v1alpha1"
55
"fmt"
66
)
77

0 commit comments

Comments
 (0)