Skip to content

Commit

Permalink
comment out connection restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
bharath-123 committed Nov 27, 2024
1 parent 529c24a commit af19469
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions grpc/optimistic/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ func NewOptimisticServiceV1Alpha(sharedServiceContainer *shared.SharedServiceCon

func (o *OptimisticServiceV1Alpha1) GetBundleStream(_ *optimsticPb.GetBundleStreamRequest, stream optimisticGrpc.BundleService_GetBundleStreamServer) error {
log.Debug("GetBundleStream called")
if !o.bundleStreamConnected.CompareAndSwap(false, true) {
return status.Error(codes.PermissionDenied, "Bundle stream has already been connected to")
}

// when the stream is closed, we need to set the bundleStreamConnected to false
defer o.bundleStreamConnected.Store(false)
//if !o.bundleStreamConnected.CompareAndSwap(false, true) {
// return status.Error(codes.PermissionDenied, "Bundle stream has already been connected to")
//}
//
//// when the stream is closed, we need to set the bundleStreamConnected to false
//defer o.bundleStreamConnected.Store(false)

pendingTxEventCh := make(chan core.NewTxsEvent)
pendingTxEvent := o.Eth().TxPool().SubscribeTransactions(pendingTxEventCh, false)
Expand Down Expand Up @@ -113,12 +113,12 @@ func (o *OptimisticServiceV1Alpha1) GetBundleStream(_ *optimsticPb.GetBundleStre

func (o *OptimisticServiceV1Alpha1) ExecuteOptimisticBlockStream(stream optimisticGrpc.OptimisticExecutionService_ExecuteOptimisticBlockStreamServer) error {
log.Debug("ExecuteOptimisticBlockStream called")
if !o.executeOptimisticBlockStreamConnected.CompareAndSwap(false, true) {
return status.Error(codes.PermissionDenied, "Execute optimsitic block stream has already been connected to")
}

// when the stream is closed, we need to set the bundleStreamConnected to false
defer o.executeOptimisticBlockStreamConnected.Store(false)
//if !o.executeOptimisticBlockStreamConnected.CompareAndSwap(false, true) {
// return status.Error(codes.PermissionDenied, "Execute optimistic block stream has already been connected to")
//}
//
//// when the stream is closed, we need to set the bundleStreamConnected to false
//defer o.executeOptimisticBlockStreamConnected.Store(false)

mempoolClearingEventCh := make(chan core.NewMempoolCleared)
mempoolClearingEvent := o.Eth().TxPool().SubscribeMempoolClearance(mempoolClearingEventCh)
Expand Down

0 comments on commit af19469

Please sign in to comment.