@@ -17,7 +17,6 @@ var errInvalidHead = errors.New("invalid head")
1717const (
1818 rpcCallNameLatestBlock = "latest_block"
1919 rpcCallNameLatestFinalizedBlock = "latest_finalized_block"
20- rpcMetricsDefaultIsSendOnly = false
2120)
2221
2322type RPCClientBaseConfig interface {
@@ -37,6 +36,7 @@ type RPCClientBase[HEAD Head] struct {
3736 log logger.Logger
3837 ctxTimeout time.Duration
3938 rpcURL string
39+ isSendOnly bool
4040 subsMu sync.RWMutex
4141 subs map [Subscription ]struct {}
4242
@@ -65,13 +65,15 @@ func NewRPCClientBase[HEAD Head](
6565 latestBlock func (ctx context.Context ) (HEAD , error ),
6666 latestFinalizedBlock func (ctx context.Context ) (HEAD , error ),
6767 rpcURL string ,
68+ isSendOnly bool ,
6869 rpcMetrics frameworkmetrics.RPCClientMetrics ,
6970) * RPCClientBase [HEAD ] {
7071 base := & RPCClientBase [HEAD ]{
7172 cfg : cfg ,
7273 log : log ,
7374 ctxTimeout : ctxTimeout ,
7475 rpcURL : rpcURL ,
76+ isSendOnly : isSendOnly ,
7577 latestBlock : latestBlock ,
7678 latestFinalizedBlock : latestFinalizedBlock ,
7779 subs : make (map [Subscription ]struct {}),
@@ -216,7 +218,7 @@ func (m *RPCClientBase[HEAD]) recordRPCRequest(ctx context.Context, callName str
216218 return
217219 }
218220
219- m .rpcMetrics .RecordRequest (ctx , m .rpcURL , rpcMetricsDefaultIsSendOnly , callName , time .Since (startedAt ), err )
221+ m .rpcMetrics .RecordRequest (ctx , m .rpcURL , m . isSendOnly , callName , time .Since (startedAt ), err )
220222}
221223
222224func (m * RPCClientBase [HEAD ]) OnNewHead (ctx context.Context , requestCh <- chan struct {}, head HEAD ) {
0 commit comments