From f56670eea5b94d149698430c433bb2df7a76769d Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 5 Sep 2023 10:50:01 -0400 Subject: [PATCH 01/15] change interface --- pkg/types/provider_median.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/types/provider_median.go b/pkg/types/provider_median.go index 29010d82d..6a77946ae 100644 --- a/pkg/types/provider_median.go +++ b/pkg/types/provider_median.go @@ -17,7 +17,7 @@ type MedianProvider interface { type PluginMedian interface { // NewMedianFactory returns a new ReportingPluginFactory. If provider implements GRPCClientConn, it can be forwarded efficiently via proxy. - NewMedianFactory(ctx context.Context, provider MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog ErrorLog) (ReportingPluginFactory, error) + NewMedianFactory(ctx context.Context, provider MedianProvider, dataSource, juelsPerFeeCoin, gasPrice median.DataSource, errorLog ErrorLog) (ReportingPluginFactory, error) } type ReportingPluginFactory interface { From 3e033ffaaa7b7d61538084161f0e404a52fd4eb0 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Tue, 5 Sep 2023 11:31:04 -0400 Subject: [PATCH 02/15] change signature for median factory --- pkg/loop/internal/median.go | 4 ++-- pkg/loop/internal/test/median.go | 4 ++-- pkg/loop/median_service.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/loop/internal/median.go b/pkg/loop/internal/median.go index 1c217e1b3..73f94b454 100644 --- a/pkg/loop/internal/median.go +++ b/pkg/loop/internal/median.go @@ -35,7 +35,7 @@ func NewPluginMedianClient(broker Broker, brokerCfg BrokerConfig, conn *grpc.Cli return &PluginMedianClient{pluginClient: pc, median: pb.NewPluginMedianClient(pc), serviceClient: newServiceClient(pc.brokerExt, pc)} } -func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog types.ErrorLog) (types.ReportingPluginFactory, error) { +func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoin, gasPrice median.DataSource, errorLog types.ErrorLog) (types.ReportingPluginFactory, error) { cc := m.newClientConn("MedianPluginFactory", func(ctx context.Context) (id uint32, deps resources, err error) { dataSourceID, dsRes, err := m.serveNew("DataSource", func(s *grpc.Server) { pb.RegisterDataSourceServer(s, &dataSourceServer{impl: dataSource}) @@ -147,7 +147,7 @@ func (m *pluginMedianServer) NewMedianFactory(ctx context.Context, request *pb.N errorLogRes := resource{errorLogConn, "ErrorLog"} errorLog := newErrorLogClient(errorLogConn) - factory, err := m.impl.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, errorLog) + factory, err := m.impl.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, nil, errorLog) if err != nil { m.closeAll(dsRes, juelsRes, providerRes, errorLogRes) return nil, err diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index 9ea530d56..991b74f1c 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -30,7 +30,7 @@ type PluginMedianTest struct { func (m PluginMedianTest) TestPluginMedian(t *testing.T, p types.PluginMedian) { t.Run("PluginMedian", func(t *testing.T) { ctx := utils.Context(t) - factory, err := p.NewMedianFactory(ctx, m.MedianProvider, &staticDataSource{value}, &staticDataSource{juelsPerFeeCoin}, &StaticErrorLog{}) + factory, err := p.NewMedianFactory(ctx, m.MedianProvider, &staticDataSource{value}, &staticDataSource{juelsPerFeeCoin}, nil, &StaticErrorLog{}) require.NoError(t, err) TestReportingPluginFactory(t, factory) @@ -68,7 +68,7 @@ func TestReportingPluginFactory(t *testing.T, factory types.ReportingPluginFacto type StaticPluginMedian struct{} -func (s StaticPluginMedian) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoinDataSource median.DataSource, errorLog types.ErrorLog) (types.ReportingPluginFactory, error) { +func (s StaticPluginMedian) NewMedianFactory(ctx context.Context, provider types.MedianProvider, dataSource, juelsPerFeeCoinDataSource, gasPrice median.DataSource, errorLog types.ErrorLog) (types.ReportingPluginFactory, error) { ocd := provider.OffchainConfigDigester() gotDigestPrefix, err := ocd.ConfigDigestPrefix() if err != nil { diff --git a/pkg/loop/median_service.go b/pkg/loop/median_service.go index 08e2b1a8b..3765ce28e 100644 --- a/pkg/loop/median_service.go +++ b/pkg/loop/median_service.go @@ -28,7 +28,7 @@ func NewMedianService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cm if !ok { return nil, fmt.Errorf("expected PluginMedian but got %T", instance) } - return plug.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, errorLog) + return plug.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, nil, errorLog) } stopCh := make(chan struct{}) lggr = logger.Named(lggr, "MedianService") From c9882075ca40797efdd37c539f15c861ed130f88 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 8 Sep 2023 10:28:50 -0400 Subject: [PATCH 03/15] serve gasPrice over grpc --- pkg/loop/internal/broker.go | 6 ++++-- pkg/loop/internal/median.go | 33 +++++++++++++++++++++++++++---- pkg/loop/internal/pb/median.pb.go | 1 + pkg/loop/internal/pb/median.proto | 1 + 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/pkg/loop/internal/broker.go b/pkg/loop/internal/broker.go index 3109b9aaf..837764059 100644 --- a/pkg/loop/internal/broker.go +++ b/pkg/loop/internal/broker.go @@ -141,8 +141,10 @@ func (b *brokerExt) serve(name string, server *grpc.Server, deps ...resource) (u func (b *brokerExt) closeAll(deps ...resource) { for _, d := range deps { - if err := d.Close(); err != nil { - b.Logger.Error(fmt.Sprintf("Error closing %s", d.name), "err", err) + if d.Closer != nil { + if err := d.Close(); err != nil { + b.Logger.Error(fmt.Sprintf("Error closing %s", d.name), "err", err) + } } } } diff --git a/pkg/loop/internal/median.go b/pkg/loop/internal/median.go index 73f94b454..a9272f195 100644 --- a/pkg/loop/internal/median.go +++ b/pkg/loop/internal/median.go @@ -53,6 +53,18 @@ func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider type } deps.Add(juelsPerFeeCoinDataSourceRes) + var gasPriceDataSourceID uint32 + if gasPrice != nil { + var gasPriceDataSourceRes resource + gasPriceDataSourceID, gasPriceDataSourceRes, err = m.serveNew("GasPriceDataSource", func(s *grpc.Server) { + pb.RegisterDataSourceServer(s, &dataSourceServer{impl: gasPrice}) + }) + if err != nil { + return 0, nil, err + } + deps.Add(gasPriceDataSourceRes) + } + var ( providerID uint32 providerRes resource @@ -87,6 +99,7 @@ func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider type MedianProviderID: providerID, DataSourceID: dataSourceID, JuelsPerFeeCoinDataSourceID: juelsPerFeeCoinDataSourceID, + GasPriceDataSourceID: gasPriceDataSourceID, ErrorLogID: errorLogID, }) if err != nil { @@ -131,9 +144,21 @@ func (m *pluginMedianServer) NewMedianFactory(ctx context.Context, request *pb.N juelsRes := resource{juelsConn, "JuelsPerFeeCoinDataSource"} juelsPerFeeCoin := newDataSourceClient(juelsConn) + var gasPriceRes resource + var gasPrice *dataSourceClient + if request.GasPriceDataSourceID != 0 { + gasPriceConn, err := m.dial(request.GasPriceDataSourceID) + if err != nil { + m.closeAll(dsRes, juelsRes) + return nil, ErrConnDial{Name: "GasPriceDataSource", ID: request.GasPriceDataSourceID, Err: err} + } + gasPriceRes = resource{gasPriceConn, "GasPriceDataSource"} + gasPrice = newDataSourceClient(gasPriceConn) + } + providerConn, err := m.dial(request.MedianProviderID) if err != nil { - m.closeAll(dsRes, juelsRes) + m.closeAll(dsRes, juelsRes, gasPriceRes) return nil, ErrConnDial{Name: "MedianProvider", ID: request.MedianProviderID, Err: err} } providerRes := resource{providerConn, "MedianProvider"} @@ -141,15 +166,15 @@ func (m *pluginMedianServer) NewMedianFactory(ctx context.Context, request *pb.N errorLogConn, err := m.dial(request.ErrorLogID) if err != nil { - m.closeAll(dsRes, juelsRes, providerRes) + m.closeAll(dsRes, juelsRes, gasPriceRes, providerRes) return nil, ErrConnDial{Name: "ErrorLog", ID: request.ErrorLogID, Err: err} } errorLogRes := resource{errorLogConn, "ErrorLog"} errorLog := newErrorLogClient(errorLogConn) - factory, err := m.impl.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, nil, errorLog) + factory, err := m.impl.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, gasPrice, errorLog) if err != nil { - m.closeAll(dsRes, juelsRes, providerRes, errorLogRes) + m.closeAll(dsRes, juelsRes, gasPriceRes, providerRes, errorLogRes) return nil, err } diff --git a/pkg/loop/internal/pb/median.pb.go b/pkg/loop/internal/pb/median.pb.go index 6e2b22af0..366e8fd6a 100644 --- a/pkg/loop/internal/pb/median.pb.go +++ b/pkg/loop/internal/pb/median.pb.go @@ -32,6 +32,7 @@ type NewMedianFactoryRequest struct { DataSourceID uint32 `protobuf:"varint,2,opt,name=dataSourceID,proto3" json:"dataSourceID,omitempty"` JuelsPerFeeCoinDataSourceID uint32 `protobuf:"varint,3,opt,name=juelsPerFeeCoinDataSourceID,proto3" json:"juelsPerFeeCoinDataSourceID,omitempty"` ErrorLogID uint32 `protobuf:"varint,4,opt,name=errorLogID,proto3" json:"errorLogID,omitempty"` + GasPriceDataSourceID uint32 `protobuf:"varint,5,opt,name=gasPriceDataSourceID,proto3" json:"gasPriceDataSourceID,omitempty"` } func (x *NewMedianFactoryRequest) Reset() { diff --git a/pkg/loop/internal/pb/median.proto b/pkg/loop/internal/pb/median.proto index ae5c48071..48586a77b 100644 --- a/pkg/loop/internal/pb/median.proto +++ b/pkg/loop/internal/pb/median.proto @@ -18,6 +18,7 @@ message NewMedianFactoryRequest { uint32 dataSourceID = 2; uint32 juelsPerFeeCoinDataSourceID = 3; uint32 errorLogID = 4; + uint32 gasPriceDataSourceID = 5; } // NewMedianFactoryRequest has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewMedianFactory]. From c7bc6d8ce7654fd28a7234659fc7e6a81bb603bf Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 8 Sep 2023 11:00:15 -0400 Subject: [PATCH 04/15] update protobuf --- go.mod | 2 + go.sum | 4 +- pkg/loop/internal/median.go | 1 + pkg/loop/internal/pb/median.pb.go | 362 ++++++++++++++++-------------- pkg/loop/internal/pb/median.proto | 1 + 5 files changed, 198 insertions(+), 172 deletions(-) diff --git a/go.mod b/go.mod index 4b817f904..22e837f7a 100644 --- a/go.mod +++ b/go.mod @@ -65,6 +65,8 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20230901193648-78ff9454fecd + replace ( // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 github.com/hashicorp/go-plugin => github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 diff --git a/go.sum b/go.sum index 1657b8884..ff9226b2a 100644 --- a/go.sum +++ b/go.sum @@ -40,6 +40,8 @@ github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu github.com/actgardner/gogen-avro/v10 v10.2.1/go.mod h1:QUhjeHPchheYmMDni/Nx7VB0RsT/ee8YIgGY/xpEQgQ= github.com/actgardner/gogen-avro/v9 v9.1.0/go.mod h1:nyTj6wPqDJoxM3qdnjcLv+EnMDSDFqE0qDpva2QRmKc= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/augustbleeds/libocr v0.0.0-20230901193648-78ff9454fecd h1:Iw9NqPsR8Oc71t+k3rjt0o2X2Imz4ZciluAlvb6lX7w= +github.com/augustbleeds/libocr v0.0.0-20230901193648-78ff9454fecd/go.mod h1:2lyRkw/qLQgUWlrWWmq5nj0y90rWeO6Y+v+fCakRgb0= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -254,8 +256,6 @@ github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472 h1:x3kN github.com/smartcontractkit/go-plugin v0.0.0-20230605132010-0f4d515d1472/go.mod h1:6/1TEzT0eQznvI/gV2CM29DLSkAK/e58mUWKVsPaph0= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f h1:hgJif132UCdjo8u43i7iPN1/MFnu49hv7lFGFftCHKU= github.com/smartcontractkit/grpc-proxy v0.0.0-20230731113816-f1be6620749f/go.mod h1:MvMXoufZAtqExNexqi4cjrNYE9MefKddKylxjS+//n0= -github.com/smartcontractkit/libocr v0.0.0-20230802221916-2271752fa829 h1:fzefK1SzoRSHzZduOCzIJ2kmkBMPKwIf3FgeBlw7Jjk= -github.com/smartcontractkit/libocr v0.0.0-20230802221916-2271752fa829/go.mod h1:2lyRkw/qLQgUWlrWWmq5nj0y90rWeO6Y+v+fCakRgb0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= diff --git a/pkg/loop/internal/median.go b/pkg/loop/internal/median.go index a9272f195..e8dcd3d39 100644 --- a/pkg/loop/internal/median.go +++ b/pkg/loop/internal/median.go @@ -247,6 +247,7 @@ func (r *reportCodecClient) BuildReport(observations []median.ParsedAttributedOb Value: pb.NewBigIntFromInt(o.Value), JulesPerFeeCoin: pb.NewBigIntFromInt(o.JuelsPerFeeCoin), Observer: uint32(o.Observer), + GasPrice: pb.NewBigIntFromInt(o.GasPrice), }) } var reply *pb.BuildReportReply diff --git a/pkg/loop/internal/pb/median.pb.go b/pkg/loop/internal/pb/median.pb.go index 366e8fd6a..18137dded 100644 --- a/pkg/loop/internal/pb/median.pb.go +++ b/pkg/loop/internal/pb/median.pb.go @@ -32,7 +32,7 @@ type NewMedianFactoryRequest struct { DataSourceID uint32 `protobuf:"varint,2,opt,name=dataSourceID,proto3" json:"dataSourceID,omitempty"` JuelsPerFeeCoinDataSourceID uint32 `protobuf:"varint,3,opt,name=juelsPerFeeCoinDataSourceID,proto3" json:"juelsPerFeeCoinDataSourceID,omitempty"` ErrorLogID uint32 `protobuf:"varint,4,opt,name=errorLogID,proto3" json:"errorLogID,omitempty"` - GasPriceDataSourceID uint32 `protobuf:"varint,5,opt,name=gasPriceDataSourceID,proto3" json:"gasPriceDataSourceID,omitempty"` + GasPriceDataSourceID uint32 `protobuf:"varint,5,opt,name=gasPriceDataSourceID,proto3" json:"gasPriceDataSourceID,omitempty"` } func (x *NewMedianFactoryRequest) Reset() { @@ -95,6 +95,13 @@ func (x *NewMedianFactoryRequest) GetErrorLogID() uint32 { return 0 } +func (x *NewMedianFactoryRequest) GetGasPriceDataSourceID() uint32 { + if x != nil { + return x.GasPriceDataSourceID + } + return 0 +} + // NewMedianFactoryRequest has return arguments for [github.com/smartcontractkit/chainlink-relay/pkg/loop.Relayer.NewMedianFactory]. type NewMedianFactoryReply struct { state protoimpl.MessageState @@ -201,6 +208,7 @@ type ParsedAttributedObservation struct { Value *BigInt `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` JulesPerFeeCoin *BigInt `protobuf:"bytes,3,opt,name=julesPerFeeCoin,proto3" json:"julesPerFeeCoin,omitempty"` Observer uint32 `protobuf:"varint,4,opt,name=observer,proto3" json:"observer,omitempty"` // uint8 + GasPrice *BigInt `protobuf:"bytes,5,opt,name=gasPrice,proto3" json:"gasPrice,omitempty"` } func (x *ParsedAttributedObservation) Reset() { @@ -263,6 +271,13 @@ func (x *ParsedAttributedObservation) GetObserver() uint32 { return 0 } +func (x *ParsedAttributedObservation) GetGasPrice() *BigInt { + if x != nil { + return x.GasPrice + } + return nil +} + // BuildReportRequest has arguments for [github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median.ReportCodec.BuildReport]. type BuildReportRequest struct { state protoimpl.MessageState @@ -1038,7 +1053,7 @@ var file_median_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0d, 0x72, 0x65, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x17, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, + 0x6f, 0x22, 0xff, 0x01, 0x0a, 0x17, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2a, 0x0a, 0x10, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x10, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x50, @@ -1050,147 +1065,153 @@ var file_median_proto_rawDesc = []byte{ 0x28, 0x0d, 0x52, 0x1b, 0x6a, 0x75, 0x65, 0x6c, 0x73, 0x50, 0x65, 0x72, 0x46, 0x65, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x12, 0x1e, 0x0a, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x49, 0x44, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x49, 0x44, 0x22, - 0x53, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3a, 0x0a, 0x18, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x79, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, 0x72, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x79, 0x49, 0x44, 0x22, 0x2c, 0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, 0x45, 0x72, 0x72, 0x6f, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x22, 0xb3, 0x01, 0x0a, 0x1b, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, 0x41, 0x74, 0x74, - 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x05, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x0f, 0x6a, 0x75, 0x6c, 0x65, 0x73, 0x50, 0x65, 0x72, - 0x46, 0x65, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6a, 0x75, 0x6c, - 0x65, 0x73, 0x50, 0x65, 0x72, 0x46, 0x65, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, - 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x22, 0x5b, 0x0a, 0x12, 0x42, 0x75, 0x69, 0x6c, - 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, - 0x0a, 0x0c, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x73, - 0x65, 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, - 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x2a, 0x0a, 0x10, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x22, 0x31, 0x0a, 0x17, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, - 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, - 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, - 0x70, 0x6f, 0x72, 0x74, 0x22, 0x3d, 0x0a, 0x15, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, - 0x6f, 0x6d, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, - 0x06, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x65, 0x64, - 0x69, 0x61, 0x6e, 0x22, 0x26, 0x0a, 0x16, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0c, 0x0a, - 0x01, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x01, 0x6e, 0x22, 0x28, 0x0a, 0x14, 0x4d, - 0x61, 0x78, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0x22, 0x0a, 0x20, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, - 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe8, 0x01, 0x0a, 0x1e, 0x4c, 0x61, - 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x22, 0x0a, 0x0c, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x30, 0x0a, 0x0c, - 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, - 0x52, 0x0c, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x44, - 0x0a, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x22, 0x39, 0x0a, 0x1b, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x6f, - 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x6f, 0x6b, 0x62, 0x61, 0x63, 0x6b, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x6f, 0x6f, 0x6b, 0x62, 0x61, 0x63, 0x6b, 0x22, - 0x6b, 0x0a, 0x19, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x22, 0x0a, 0x0c, - 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, - 0x12, 0x14, 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, - 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x4f, 0x0a, 0x0d, - 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1e, 0x0a, - 0x03, 0x6d, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x1e, 0x0a, - 0x03, 0x6d, 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0x4a, 0x0a, - 0x0d, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, - 0x0a, 0x0d, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4f, 0x6e, 0x63, - 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6f, 0x6e, 0x63, 0x68, - 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x27, 0x0a, 0x0b, 0x45, 0x6e, 0x63, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, - 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, - 0x65, 0x64, 0x22, 0x29, 0x0a, 0x0d, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22, 0x48, 0x0a, - 0x0b, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x39, 0x0a, 0x0d, + 0x01, 0x28, 0x0d, 0x52, 0x0a, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x49, 0x44, 0x12, + 0x32, 0x0a, 0x14, 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x44, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x14, 0x67, + 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x44, 0x61, 0x74, 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, + 0x65, 0x49, 0x44, 0x22, 0x53, 0x0a, 0x15, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, + 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x3a, 0x0a, 0x18, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x46, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x18, + 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x46, + 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x44, 0x22, 0x2c, 0x0a, 0x10, 0x53, 0x61, 0x76, 0x65, + 0x45, 0x72, 0x72, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, + 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xdd, 0x01, 0x0a, 0x1b, 0x50, 0x61, 0x72, 0x73, 0x65, + 0x64, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, + 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, + 0x61, 0x6d, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x12, 0x22, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, + 0x74, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x0f, 0x6a, 0x75, 0x6c, 0x65, + 0x73, 0x50, 0x65, 0x72, 0x46, 0x65, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, + 0x0f, 0x6a, 0x75, 0x6c, 0x65, 0x73, 0x50, 0x65, 0x72, 0x46, 0x65, 0x65, 0x43, 0x6f, 0x69, 0x6e, + 0x12, 0x1a, 0x0a, 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x08, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x08, + 0x67, 0x61, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x67, 0x61, + 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x5b, 0x0a, 0x12, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, + 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x45, 0x0a, 0x0c, + 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x73, 0x65, 0x64, + 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x64, 0x4f, 0x62, 0x73, 0x65, 0x72, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0c, 0x6f, 0x62, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x22, 0x2a, 0x0a, 0x10, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, + 0x31, 0x0a, 0x17, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, + 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x72, 0x65, 0x70, 0x6f, + 0x72, 0x74, 0x22, 0x3d, 0x0a, 0x15, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x24, 0x0a, 0x06, 0x6d, + 0x65, 0x64, 0x69, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x06, 0x6d, 0x65, 0x64, 0x69, 0x61, + 0x6e, 0x22, 0x26, 0x0a, 0x16, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, + 0x6e, 0x67, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x01, 0x6e, 0x22, 0x28, 0x0a, 0x14, 0x4d, 0x61, 0x78, + 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x52, 0x65, 0x70, 0x6c, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x61, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x6d, 0x61, 0x78, 0x22, 0x22, 0x0a, 0x20, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xe8, 0x01, 0x0a, 0x1e, 0x4c, 0x61, 0x74, 0x65, + 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x30, 0x0a, 0x0c, 0x6c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x0c, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x0f, + 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x52, 0x0f, 0x6c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x22, 0x39, 0x0a, 0x1b, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x6f, 0x6f, 0x6b, 0x62, 0x61, 0x63, 0x6b, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x08, 0x6c, 0x6f, 0x6f, 0x6b, 0x62, 0x61, 0x63, 0x6b, 0x22, 0x6b, 0x0a, + 0x19, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x22, 0x0a, 0x0c, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x0c, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x44, 0x69, 0x67, 0x65, 0x73, 0x74, 0x12, 0x14, + 0x0a, 0x05, 0x65, 0x70, 0x6f, 0x63, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x65, + 0x70, 0x6f, 0x63, 0x68, 0x12, 0x14, 0x0a, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0d, 0x52, 0x05, 0x72, 0x6f, 0x75, 0x6e, 0x64, 0x22, 0x4f, 0x0a, 0x0d, 0x4f, 0x6e, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x1e, 0x0a, 0x03, 0x6d, + 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x03, 0x6d, + 0x61, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x42, 0x69, 0x67, 0x49, 0x6e, 0x74, 0x52, 0x03, 0x6d, 0x61, 0x78, 0x22, 0x4a, 0x0a, 0x0d, 0x45, + 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, 0x0d, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x60, 0x0a, 0x0c, 0x50, 0x6c, 0x75, 0x67, 0x69, - 0x6e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x12, 0x50, 0x0a, 0x10, 0x4e, 0x65, 0x77, 0x4d, 0x65, - 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x49, 0x0a, 0x08, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x4c, 0x6f, 0x67, 0x12, 0x3d, 0x0a, 0x09, 0x53, 0x61, 0x76, 0x65, 0x45, 0x72, 0x72, - 0x6f, 0x72, 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x45, 0x72, - 0x72, 0x6f, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x32, 0xf1, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, - 0x6f, 0x64, 0x65, 0x63, 0x12, 0x41, 0x0a, 0x0b, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, - 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x10, 0x4d, 0x65, 0x64, 0x69, 0x61, - 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, - 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0f, 0x4d, 0x61, 0x78, - 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1c, 0x2e, 0x6c, - 0x6f, 0x6f, 0x70, 0x2e, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, - 0x67, 0x74, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, 0x6f, 0x6f, + 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x27, 0x0a, 0x0b, 0x45, 0x6e, 0x63, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, + 0x22, 0x29, 0x0a, 0x0d, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x07, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x64, 0x22, 0x48, 0x0a, 0x0b, 0x44, + 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x39, 0x0a, 0x0d, 0x6f, 0x6e, + 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, + 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x0d, 0x6f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x32, 0x60, 0x0a, 0x0c, 0x50, 0x6c, 0x75, 0x67, 0x69, 0x6e, 0x4d, + 0x65, 0x64, 0x69, 0x61, 0x6e, 0x12, 0x50, 0x0a, 0x10, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, + 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x2e, 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x4e, 0x65, 0x77, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x49, 0x0a, 0x08, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x4c, 0x6f, 0x67, 0x12, 0x3d, 0x0a, 0x09, 0x53, 0x61, 0x76, 0x65, 0x45, 0x72, 0x72, 0x6f, 0x72, + 0x12, 0x16, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x53, 0x61, 0x76, 0x65, 0x45, 0x72, 0x72, 0x6f, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x00, 0x32, 0xf1, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x43, 0x6f, 0x64, + 0x65, 0x63, 0x12, 0x41, 0x0a, 0x0b, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x12, 0x18, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6c, 0x6f, + 0x6f, 0x70, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, + 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x50, 0x0a, 0x10, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, + 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x2e, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, 0x6f, 0x72, + 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x4d, 0x65, 0x64, 0x69, 0x61, 0x6e, 0x46, 0x72, 0x6f, 0x6d, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4d, 0x0a, 0x0f, 0x4d, 0x61, 0x78, 0x52, 0x65, + 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x12, 0x1c, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, - 0x68, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0xdb, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x64, - 0x69, 0x61, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x6b, 0x0a, 0x19, 0x4c, - 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x26, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, - 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x24, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, - 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x14, 0x4c, 0x61, 0x74, 0x65, - 0x73, 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, - 0x12, 0x21, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x6f, - 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, - 0x74, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x7c, 0x0a, 0x12, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x32, 0x0a, 0x06, - 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x45, 0x6e, - 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x6f, - 0x6f, 0x70, 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, - 0x12, 0x32, 0x0a, 0x06, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, - 0x70, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x11, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, - 0x6c, 0x79, 0x22, 0x00, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, - 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x72, 0x65, - 0x6c, 0x61, 0x79, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x4d, 0x61, 0x78, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0xdb, 0x01, 0x0a, 0x0e, 0x4d, 0x65, 0x64, 0x69, 0x61, + 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x6b, 0x0a, 0x19, 0x4c, 0x61, 0x74, + 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, + 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x26, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, + 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, + 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x14, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, + 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x12, 0x21, + 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, 0x6f, 0x75, 0x6e, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x4c, 0x61, 0x74, 0x65, 0x73, 0x74, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, + 0x6c, 0x79, 0x22, 0x00, 0x32, 0x7c, 0x0a, 0x12, 0x4f, 0x6e, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x43, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x43, 0x6f, 0x64, 0x65, 0x63, 0x12, 0x32, 0x0a, 0x06, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, + 0x2e, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x32, + 0x0a, 0x06, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x13, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x2e, + 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, + 0x6c, 0x6f, 0x6f, 0x70, 0x2e, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x22, 0x00, 0x42, 0x42, 0x5a, 0x40, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, + 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x72, 0x65, 0x6c, 0x61, + 0x79, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1233,37 +1254,38 @@ var file_median_proto_goTypes = []interface{}{ var file_median_proto_depIdxs = []int32{ 19, // 0: loop.ParsedAttributedObservation.value:type_name -> loop.BigInt 19, // 1: loop.ParsedAttributedObservation.julesPerFeeCoin:type_name -> loop.BigInt - 3, // 2: loop.BuildReportRequest.observations:type_name -> loop.ParsedAttributedObservation - 19, // 3: loop.MedianFromReportReply.median:type_name -> loop.BigInt - 19, // 4: loop.LatestTransmissionDetailsReply.latestAnswer:type_name -> loop.BigInt - 20, // 5: loop.LatestTransmissionDetailsReply.latestTimestamp:type_name -> google.protobuf.Timestamp - 19, // 6: loop.OnchainConfig.min:type_name -> loop.BigInt - 19, // 7: loop.OnchainConfig.max:type_name -> loop.BigInt - 14, // 8: loop.EncodeRequest.onchainConfig:type_name -> loop.OnchainConfig - 14, // 9: loop.DecodeReply.onchainConfig:type_name -> loop.OnchainConfig - 0, // 10: loop.PluginMedian.NewMedianFactory:input_type -> loop.NewMedianFactoryRequest - 2, // 11: loop.ErrorLog.SaveError:input_type -> loop.SaveErrorRequest - 4, // 12: loop.ReportCodec.BuildReport:input_type -> loop.BuildReportRequest - 6, // 13: loop.ReportCodec.MedianFromReport:input_type -> loop.MedianFromReportRequest - 8, // 14: loop.ReportCodec.MaxReportLength:input_type -> loop.MaxReportLengthRequest - 10, // 15: loop.MedianContract.LatestTransmissionDetails:input_type -> loop.LatestTransmissionDetailsRequest - 12, // 16: loop.MedianContract.LatestRoundRequested:input_type -> loop.LatestRoundRequestedRequest - 15, // 17: loop.OnchainConfigCodec.Encode:input_type -> loop.EncodeRequest - 17, // 18: loop.OnchainConfigCodec.Decode:input_type -> loop.DecodeRequest - 1, // 19: loop.PluginMedian.NewMedianFactory:output_type -> loop.NewMedianFactoryReply - 21, // 20: loop.ErrorLog.SaveError:output_type -> google.protobuf.Empty - 5, // 21: loop.ReportCodec.BuildReport:output_type -> loop.BuildReportReply - 7, // 22: loop.ReportCodec.MedianFromReport:output_type -> loop.MedianFromReportReply - 9, // 23: loop.ReportCodec.MaxReportLength:output_type -> loop.MaxReportLengthReply - 11, // 24: loop.MedianContract.LatestTransmissionDetails:output_type -> loop.LatestTransmissionDetailsReply - 13, // 25: loop.MedianContract.LatestRoundRequested:output_type -> loop.LatestRoundRequestedReply - 16, // 26: loop.OnchainConfigCodec.Encode:output_type -> loop.EncodeReply - 18, // 27: loop.OnchainConfigCodec.Decode:output_type -> loop.DecodeReply - 19, // [19:28] is the sub-list for method output_type - 10, // [10:19] is the sub-list for method input_type - 10, // [10:10] is the sub-list for extension type_name - 10, // [10:10] is the sub-list for extension extendee - 0, // [0:10] is the sub-list for field type_name + 19, // 2: loop.ParsedAttributedObservation.gasPrice:type_name -> loop.BigInt + 3, // 3: loop.BuildReportRequest.observations:type_name -> loop.ParsedAttributedObservation + 19, // 4: loop.MedianFromReportReply.median:type_name -> loop.BigInt + 19, // 5: loop.LatestTransmissionDetailsReply.latestAnswer:type_name -> loop.BigInt + 20, // 6: loop.LatestTransmissionDetailsReply.latestTimestamp:type_name -> google.protobuf.Timestamp + 19, // 7: loop.OnchainConfig.min:type_name -> loop.BigInt + 19, // 8: loop.OnchainConfig.max:type_name -> loop.BigInt + 14, // 9: loop.EncodeRequest.onchainConfig:type_name -> loop.OnchainConfig + 14, // 10: loop.DecodeReply.onchainConfig:type_name -> loop.OnchainConfig + 0, // 11: loop.PluginMedian.NewMedianFactory:input_type -> loop.NewMedianFactoryRequest + 2, // 12: loop.ErrorLog.SaveError:input_type -> loop.SaveErrorRequest + 4, // 13: loop.ReportCodec.BuildReport:input_type -> loop.BuildReportRequest + 6, // 14: loop.ReportCodec.MedianFromReport:input_type -> loop.MedianFromReportRequest + 8, // 15: loop.ReportCodec.MaxReportLength:input_type -> loop.MaxReportLengthRequest + 10, // 16: loop.MedianContract.LatestTransmissionDetails:input_type -> loop.LatestTransmissionDetailsRequest + 12, // 17: loop.MedianContract.LatestRoundRequested:input_type -> loop.LatestRoundRequestedRequest + 15, // 18: loop.OnchainConfigCodec.Encode:input_type -> loop.EncodeRequest + 17, // 19: loop.OnchainConfigCodec.Decode:input_type -> loop.DecodeRequest + 1, // 20: loop.PluginMedian.NewMedianFactory:output_type -> loop.NewMedianFactoryReply + 21, // 21: loop.ErrorLog.SaveError:output_type -> google.protobuf.Empty + 5, // 22: loop.ReportCodec.BuildReport:output_type -> loop.BuildReportReply + 7, // 23: loop.ReportCodec.MedianFromReport:output_type -> loop.MedianFromReportReply + 9, // 24: loop.ReportCodec.MaxReportLength:output_type -> loop.MaxReportLengthReply + 11, // 25: loop.MedianContract.LatestTransmissionDetails:output_type -> loop.LatestTransmissionDetailsReply + 13, // 26: loop.MedianContract.LatestRoundRequested:output_type -> loop.LatestRoundRequestedReply + 16, // 27: loop.OnchainConfigCodec.Encode:output_type -> loop.EncodeReply + 18, // 28: loop.OnchainConfigCodec.Decode:output_type -> loop.DecodeReply + 20, // [20:29] is the sub-list for method output_type + 11, // [11:20] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name } func init() { file_median_proto_init() } diff --git a/pkg/loop/internal/pb/median.proto b/pkg/loop/internal/pb/median.proto index 48586a77b..1086e3545 100644 --- a/pkg/loop/internal/pb/median.proto +++ b/pkg/loop/internal/pb/median.proto @@ -47,6 +47,7 @@ message ParsedAttributedObservation { BigInt value = 2; BigInt julesPerFeeCoin = 3; uint32 observer = 4; // uint8 + BigInt gasPrice = 5; } // BuildReportRequest has arguments for [github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median.ReportCodec.BuildReport]. From 0aa1d2df896f281e851e9c1fc350c1481f00d3c8 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 8 Sep 2023 11:59:45 -0400 Subject: [PATCH 05/15] add tests --- pkg/loop/internal/test/datasource.go | 2 ++ pkg/loop/internal/test/median.go | 10 +++++++- pkg/loop/internal/test/test.go | 1 + pkg/loop/median_service.go | 4 ++-- pkg/loop/median_service_test.go | 36 ++++++++++++++++++++++++++-- 5 files changed, 48 insertions(+), 5 deletions(-) diff --git a/pkg/loop/internal/test/datasource.go b/pkg/loop/internal/test/datasource.go index e62a989be..c9db36942 100644 --- a/pkg/loop/internal/test/datasource.go +++ b/pkg/loop/internal/test/datasource.go @@ -19,6 +19,8 @@ func StaticDataSource() median.DataSource { return &staticDataSource{value} } func StaticJuelsPerFeeCoinDataSource() median.DataSource { return &staticDataSource{juelsPerFeeCoin} } +func StaticGasPriceDataSource() median.DataSource { return &staticDataSource{gasPrice} } + func (s *staticDataSource) Observe(ctx context.Context, timestamp types.ReportTimestamp) (*big.Int, error) { if timestamp != reportContext.ReportTimestamp { return nil, fmt.Errorf("expected %v but got %v", reportContext.ReportTimestamp, timestamp) diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index 991b74f1c..c57e64d4c 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -28,13 +28,21 @@ type PluginMedianTest struct { } func (m PluginMedianTest) TestPluginMedian(t *testing.T, p types.PluginMedian) { - t.Run("PluginMedian", func(t *testing.T) { + t.Run("PluginMedian No GasPriceDataSource", func(t *testing.T) { ctx := utils.Context(t) factory, err := p.NewMedianFactory(ctx, m.MedianProvider, &staticDataSource{value}, &staticDataSource{juelsPerFeeCoin}, nil, &StaticErrorLog{}) require.NoError(t, err) TestReportingPluginFactory(t, factory) }) + + t.Run("PluginMedian With GasPriceDataSource", func(t *testing.T) { + ctx := utils.Context(t) + factory, err := p.NewMedianFactory(ctx, m.MedianProvider, &staticDataSource{value}, &staticDataSource{juelsPerFeeCoin}, &staticDataSource{gasPrice}, &StaticErrorLog{}) + require.NoError(t, err) + + TestReportingPluginFactory(t, factory) + }) } func TestReportingPluginFactory(t *testing.T, factory types.ReportingPluginFactory) { diff --git a/pkg/loop/internal/test/test.go b/pkg/loop/internal/test/test.go index bd9e6426f..e674f1367 100644 --- a/pkg/loop/internal/test/test.go +++ b/pkg/loop/internal/test/test.go @@ -56,6 +56,7 @@ var ( } encoded = []byte{5: 11} juelsPerFeeCoin = big.NewInt(1234) + gasPrice = big.NewInt(777) onchainConfig = median.OnchainConfig{Min: big.NewInt(-12), Max: big.NewInt(1234567890987654321)} latestAnswer = big.NewInt(-66) latestTimestamp = time.Unix(1234567890, 987654321) diff --git a/pkg/loop/median_service.go b/pkg/loop/median_service.go index 3765ce28e..290c33ccd 100644 --- a/pkg/loop/median_service.go +++ b/pkg/loop/median_service.go @@ -22,13 +22,13 @@ type MedianService struct { // NewMedianService returns a new [*MedianService]. // cmd must return a new exec.Cmd each time it is called. -func NewMedianService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cmd, provider types.MedianProvider, dataSource, juelsPerFeeCoin median.DataSource, errorLog types.ErrorLog) *MedianService { +func NewMedianService(lggr logger.Logger, grpcOpts GRPCOpts, cmd func() *exec.Cmd, provider types.MedianProvider, dataSource, juelsPerFeeCoin, gasPrice median.DataSource, errorLog types.ErrorLog) *MedianService { newService := func(ctx context.Context, instance any) (types.ReportingPluginFactory, error) { plug, ok := instance.(types.PluginMedian) if !ok { return nil, fmt.Errorf("expected PluginMedian but got %T", instance) } - return plug.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, nil, errorLog) + return plug.NewMedianFactory(ctx, provider, dataSource, juelsPerFeeCoin, gasPrice, errorLog) } stopCh := make(chan struct{}) lggr = logger.Named(lggr, "MedianService") diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index 2774212f9..e2f444a82 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -20,7 +20,39 @@ func TestMedianService(t *testing.T) { t.Parallel() median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { return helperProcess(loop.PluginMedianName) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), &test.StaticErrorLog{}) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.StaticGasPriceDataSource(), &test.StaticErrorLog{}) + hook := median.TestHook() + require.NoError(t, median.Start(utils.Context(t))) + t.Cleanup(func() { assert.NoError(t, median.Close()) }) + + t.Run("control", func(t *testing.T) { + test.TestReportingPluginFactory(t, median) + }) + + t.Run("Kill", func(t *testing.T) { + hook.Kill() + + // wait for relaunch + time.Sleep(2 * loop.KeepAliveTickDuration) + + test.TestReportingPluginFactory(t, median) + }) + + t.Run("Reset", func(t *testing.T) { + hook.Reset() + + // wait for relaunch + time.Sleep(2 * loop.KeepAliveTickDuration) + + test.TestReportingPluginFactory(t, median) + }) +} + +func TestMedianServiceNoGasPrice(t *testing.T) { + t.Parallel() + median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { + return helperProcess(loop.PluginMedianName) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), nil, &test.StaticErrorLog{}) hook := median.TestHook() require.NoError(t, median.Start(utils.Context(t))) t.Cleanup(func() { assert.NoError(t, median.Close()) }) @@ -53,7 +85,7 @@ func TestMedianService_recovery(t *testing.T) { var limit atomic.Int32 median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { return helperProcess(loop.PluginMedianName, strconv.Itoa(int(limit.Add(1)))) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), &test.StaticErrorLog{}) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.StaticGasPriceDataSource(), &test.StaticErrorLog{}) require.NoError(t, median.Start(utils.Context(t))) t.Cleanup(func() { assert.NoError(t, median.Close()) }) From e51f8622e46eecd5dbac1a7ee0e82bbe76ec1107 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Mon, 18 Sep 2023 21:13:01 +0800 Subject: [PATCH 06/15] lint fix --- pkg/loop/internal/median.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/loop/internal/median.go b/pkg/loop/internal/median.go index 00bdd8eeb..bc8abdc3d 100644 --- a/pkg/loop/internal/median.go +++ b/pkg/loop/internal/median.go @@ -147,10 +147,10 @@ func (m *pluginMedianServer) NewMedianFactory(ctx context.Context, request *pb.N var gasPriceRes resource var gasPrice *dataSourceClient if request.GasPriceDataSourceID != 0 { - gasPriceConn, err := m.dial(request.GasPriceDataSourceID) - if err != nil { + gasPriceConn, dialErr := m.dial(request.GasPriceDataSourceID) + if dialErr != nil { m.closeAll(dsRes, juelsRes) - return nil, ErrConnDial{Name: "GasPriceDataSource", ID: request.GasPriceDataSourceID, Err: err} + return nil, ErrConnDial{Name: "GasPriceDataSource", ID: request.GasPriceDataSourceID, Err: dialErr} } gasPriceRes = resource{gasPriceConn, "GasPriceDataSource"} gasPrice = newDataSourceClient(gasPriceConn) From c604ab9ba96f7c1c70f603a9012c1a303e7af2cb Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 12 Jan 2024 14:39:46 -0500 Subject: [PATCH 07/15] change to noop data source --- go.mod | 19 +++++++-------- go.sum | 36 ++++++++++++++-------------- pkg/loop/internal/broker.go | 6 ++--- pkg/loop/internal/median.go | 32 ++++++++++--------------- pkg/loop/internal/test/datasource.go | 7 ++++++ pkg/loop/internal/test/median.go | 4 ++-- pkg/loop/median_service_test.go | 4 ++-- 7 files changed, 52 insertions(+), 56 deletions(-) diff --git a/go.mod b/go.mod index 22e837f7a..6b2517e77 100644 --- a/go.mod +++ b/go.mod @@ -23,9 +23,9 @@ require ( go.opentelemetry.io/otel/trace v1.16.0 go.uber.org/goleak v1.2.1 go.uber.org/zap v1.24.0 - golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 + golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa google.golang.org/grpc v1.55.0 - google.golang.org/protobuf v1.30.0 + google.golang.org/protobuf v1.31.0 ) require ( @@ -41,7 +41,7 @@ require ( github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.0.0-rc.3 // indirect github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.16 // indirect + github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mr-tron/base58 v1.2.0 // indirect @@ -50,22 +50,21 @@ require ( github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect github.com/prometheus/procfs v0.9.0 // indirect - github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 // indirect github.com/stretchr/objx v0.5.0 // indirect go.opentelemetry.io/otel/metric v1.16.0 // indirect go.uber.org/atomic v1.10.0 // indirect go.uber.org/multierr v1.11.0 // indirect - golang.org/x/crypto v0.9.0 // indirect - golang.org/x/net v0.10.0 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/sys v0.8.0 // indirect - golang.org/x/text v0.9.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/net v0.18.0 // indirect + golang.org/x/sync v0.5.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20230901193648-78ff9454fecd +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240112185046-e95ee7bb3d72 replace ( // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 diff --git a/go.sum b/go.sum index ff9226b2a..0bd1016d1 100644 --- a/go.sum +++ b/go.sum @@ -40,8 +40,8 @@ github.com/actgardner/gogen-avro/v10 v10.1.0/go.mod h1:o+ybmVjEa27AAr35FRqU98DJu github.com/actgardner/gogen-avro/v10 v10.2.1/go.mod h1:QUhjeHPchheYmMDni/Nx7VB0RsT/ee8YIgGY/xpEQgQ= github.com/actgardner/gogen-avro/v9 v9.1.0/go.mod h1:nyTj6wPqDJoxM3qdnjcLv+EnMDSDFqE0qDpva2QRmKc= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= -github.com/augustbleeds/libocr v0.0.0-20230901193648-78ff9454fecd h1:Iw9NqPsR8Oc71t+k3rjt0o2X2Imz4ZciluAlvb6lX7w= -github.com/augustbleeds/libocr v0.0.0-20230901193648-78ff9454fecd/go.mod h1:2lyRkw/qLQgUWlrWWmq5nj0y90rWeO6Y+v+fCakRgb0= +github.com/augustbleeds/libocr v0.0.0-20240112185046-e95ee7bb3d72 h1:w5vqw1BTW0p3C6u7pdKwkDKQYVluMHgM6wRcyvLRCos= +github.com/augustbleeds/libocr v0.0.0-20240112185046-e95ee7bb3d72/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/benbjohnson/clock v1.3.0 h1:ip6w0uFQkncKQ979AypyG0ER7mqUSBdKLOgAle/AT8A= github.com/benbjohnson/clock v1.3.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -208,8 +208,9 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= -github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo= github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -246,7 +247,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/santhosh-tekuri/jsonschema/v5 v5.0.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= github.com/santhosh-tekuri/jsonschema/v5 v5.1.1 h1:lEOLY2vyGIqKWUI9nzsOJRV3mb3WC9dXYORsLEUcoeY= github.com/santhosh-tekuri/jsonschema/v5 v5.1.1/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0= @@ -304,8 +304,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g= -golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -316,8 +316,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53 h1:5llv2sWeaMSnA3w2kS57ouQQ4pudlXrR0dCgw51QK9o= -golang.org/x/exp v0.0.0-20230425010034-47ecfdc1ba53/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= +golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -371,8 +371,8 @@ golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLd golang.org/x/net v0.0.0-20210331212208-0fccb6fa2b5c/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= -golang.org/x/net v0.10.0 h1:X2//UzNDwYmtCLn7To6G58Wr6f5ahEAQgKNzv9Y951M= -golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= +golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= +golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -390,8 +390,8 @@ golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -432,8 +432,8 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= -golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -442,8 +442,8 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE= -golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -586,8 +586,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/avro.v0 v0.0.0-20171217001914-a730b5802183/go.mod h1:FvqrFXt+jCsyQibeRv4xxEJBL5iG2DDW5aeJwzDiq4A= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/pkg/loop/internal/broker.go b/pkg/loop/internal/broker.go index 837764059..3109b9aaf 100644 --- a/pkg/loop/internal/broker.go +++ b/pkg/loop/internal/broker.go @@ -141,10 +141,8 @@ func (b *brokerExt) serve(name string, server *grpc.Server, deps ...resource) (u func (b *brokerExt) closeAll(deps ...resource) { for _, d := range deps { - if d.Closer != nil { - if err := d.Close(); err != nil { - b.Logger.Error(fmt.Sprintf("Error closing %s", d.name), "err", err) - } + if err := d.Close(); err != nil { + b.Logger.Error(fmt.Sprintf("Error closing %s", d.name), "err", err) } } } diff --git a/pkg/loop/internal/median.go b/pkg/loop/internal/median.go index bc8abdc3d..015000794 100644 --- a/pkg/loop/internal/median.go +++ b/pkg/loop/internal/median.go @@ -53,17 +53,13 @@ func (m *PluginMedianClient) NewMedianFactory(ctx context.Context, provider type } deps.Add(juelsPerFeeCoinDataSourceRes) - var gasPriceDataSourceID uint32 - if gasPrice != nil { - var gasPriceDataSourceRes resource - gasPriceDataSourceID, gasPriceDataSourceRes, err = m.serveNew("GasPriceDataSource", func(s *grpc.Server) { - pb.RegisterDataSourceServer(s, &dataSourceServer{impl: gasPrice}) - }) - if err != nil { - return 0, nil, err - } - deps.Add(gasPriceDataSourceRes) + gasPriceDataSourceID, gasPriceDataSourceRes, err := m.serveNew("GasPriceDataSource", func(s *grpc.Server) { + pb.RegisterDataSourceServer(s, &dataSourceServer{impl: gasPrice}) + }) + if err != nil { + return 0, nil, err } + deps.Add(gasPriceDataSourceRes) var ( providerID uint32 @@ -144,17 +140,13 @@ func (m *pluginMedianServer) NewMedianFactory(ctx context.Context, request *pb.N juelsRes := resource{juelsConn, "JuelsPerFeeCoinDataSource"} juelsPerFeeCoin := newDataSourceClient(juelsConn) - var gasPriceRes resource - var gasPrice *dataSourceClient - if request.GasPriceDataSourceID != 0 { - gasPriceConn, dialErr := m.dial(request.GasPriceDataSourceID) - if dialErr != nil { - m.closeAll(dsRes, juelsRes) - return nil, ErrConnDial{Name: "GasPriceDataSource", ID: request.GasPriceDataSourceID, Err: dialErr} - } - gasPriceRes = resource{gasPriceConn, "GasPriceDataSource"} - gasPrice = newDataSourceClient(gasPriceConn) + gasPriceConn, err := m.dial(request.GasPriceDataSourceID) + if err != nil { + m.closeAll(dsRes, juelsRes) + return nil, ErrConnDial{Name: "GasPriceDataSource", ID: request.GasPriceDataSourceID, Err: err} } + gasPriceRes := resource{gasPriceConn, "GasPriceDataSource"} + gasPrice := newDataSourceClient(gasPriceConn) providerConn, err := m.dial(request.MedianProviderID) if err != nil { diff --git a/pkg/loop/internal/test/datasource.go b/pkg/loop/internal/test/datasource.go index c9db36942..f4090dae5 100644 --- a/pkg/loop/internal/test/datasource.go +++ b/pkg/loop/internal/test/datasource.go @@ -27,3 +27,10 @@ func (s *staticDataSource) Observe(ctx context.Context, timestamp types.ReportTi } return s.value, nil } + +type NOOPDataSource struct { +} + +func (s NOOPDataSource) Observe(ctx context.Context, _ types.ReportTimestamp) (*big.Int, error) { + return nil, median.ErrNOOPDataSource +} diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index c57e64d4c..ab23e43c5 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -28,9 +28,9 @@ type PluginMedianTest struct { } func (m PluginMedianTest) TestPluginMedian(t *testing.T, p types.PluginMedian) { - t.Run("PluginMedian No GasPriceDataSource", func(t *testing.T) { + t.Run("PluginMedian No-op GasPriceDataSource", func(t *testing.T) { ctx := utils.Context(t) - factory, err := p.NewMedianFactory(ctx, m.MedianProvider, &staticDataSource{value}, &staticDataSource{juelsPerFeeCoin}, nil, &StaticErrorLog{}) + factory, err := p.NewMedianFactory(ctx, m.MedianProvider, &staticDataSource{value}, &staticDataSource{juelsPerFeeCoin}, &NOOPDataSource{}, &StaticErrorLog{}) require.NoError(t, err) TestReportingPluginFactory(t, factory) diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index e2f444a82..16e539826 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -48,11 +48,11 @@ func TestMedianService(t *testing.T) { }) } -func TestMedianServiceNoGasPrice(t *testing.T) { +func TestMedianServiceNOOPGasPriceDataSource(t *testing.T) { t.Parallel() median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { return helperProcess(loop.PluginMedianName) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), nil, &test.StaticErrorLog{}) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.NOOPDataSource{}, &test.StaticErrorLog{}) hook := median.TestHook() require.NoError(t, median.Start(utils.Context(t))) t.Cleanup(func() { assert.NoError(t, median.Close()) }) From cde39934fb38463e3481b9594d5b665d8d03510c Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Fri, 12 Jan 2024 15:58:14 -0500 Subject: [PATCH 08/15] handle noop --- pkg/loop/internal/datasource.go | 11 +++++++++++ pkg/loop/internal/test/median.go | 3 ++- pkg/loop/median_service_test.go | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/pkg/loop/internal/datasource.go b/pkg/loop/internal/datasource.go index 656cc9114..d3ae22aab 100644 --- a/pkg/loop/internal/datasource.go +++ b/pkg/loop/internal/datasource.go @@ -2,6 +2,7 @@ package internal import ( "context" + "errors" "math/big" "google.golang.org/grpc" @@ -26,6 +27,10 @@ func (d *dataSourceClient) Observe(ctx context.Context, timestamp types.ReportTi reply, err := d.grpc.Observe(ctx, &pb.ObserveRequest{ ReportTimestamp: pbReportTimestamp(timestamp), }) + // return nil value for NOOP (only affects gas price data source) + if errors.Is(err, median.ErrNOOPDataSource) { + return nil, nil + } if err != nil { return nil, err } @@ -46,6 +51,12 @@ func (d *dataSourceServer) Observe(ctx context.Context, request *pb.ObserveReque return nil, err } val, err := d.impl.Observe(ctx, timestamp) + + // return nil value for NOOP (only affects gas price data source) + if errors.Is(err, median.ErrNOOPDataSource) { + return &pb.ObserveReply{Value: nil}, nil + } + if err != nil { return nil, err } diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index 9e0bf1696..7d77f8d41 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -3,6 +3,7 @@ package test import ( "bytes" "context" + "errors" "fmt" "math/big" "reflect" @@ -236,7 +237,7 @@ func (s StaticPluginMedian) NewMedianFactory(ctx context.Context, provider types } gotGas, err := gasPriceDataSource.Observe(ctx, reportContext.ReportTimestamp) // account for noop gas price data source - if err != nil && err != median.ErrNOOPDataSource { + if err != nil && !errors.Is(err, median.ErrNOOPDataSource) { return nil, fmt.Errorf("failed to observe juelsPerFeeCoin: %w", err) } if gotGas != nil && !assert.ObjectsAreEqual(gasPrice, gotGas) { diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index 066e7feac..d54982b00 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -45,6 +45,38 @@ func TestMedianService(t *testing.T) { }) } +func TestMedianServiceNOOPGasPriceDataSource(t *testing.T) { + t.Parallel() + + median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { + return NewHelperProcessCommand(loop.PluginMedianName) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.NOOPDataSource{}, &test.StaticErrorLog{}) + hook := median.PluginService.XXXTestHook() + servicetest.Run(t, median) + + t.Run("control", func(t *testing.T) { + test.ReportingPluginFactory(t, median) + }) + + t.Run("Kill", func(t *testing.T) { + hook.Kill() + + // wait for relaunch + time.Sleep(2 * internal.KeepAliveTickDuration) + + test.ReportingPluginFactory(t, median) + }) + + t.Run("Reset", func(t *testing.T) { + hook.Reset() + + // wait for relaunch + time.Sleep(2 * internal.KeepAliveTickDuration) + + test.ReportingPluginFactory(t, median) + }) +} + func TestMedianService_recovery(t *testing.T) { t.Parallel() var limit atomic.Int32 From 02e97ec26d20e1af1a2f3766dd985ebab250527e Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 17 Jan 2024 17:01:16 -0500 Subject: [PATCH 09/15] use nil instead of err to rep noop --- go.mod | 2 +- go.sum | 4 ++-- pkg/loop/internal/datasource.go | 12 ++---------- pkg/loop/internal/test/datasource.go | 2 +- pkg/loop/internal/test/median.go | 9 ++++----- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 49d02e2db..f704cb1e8 100644 --- a/go.mod +++ b/go.mod @@ -76,7 +76,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240112185046-e95ee7bb3d72 +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d replace ( // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 diff --git a/go.sum b/go.sum index 108121765..9c810f85d 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.9.4 h1:mnUj0ivWy6UzbB1uLFqKR6F+ZyiDc7j4iGgHTpO+5+I= github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/augustbleeds/libocr v0.0.0-20240112185046-e95ee7bb3d72 h1:w5vqw1BTW0p3C6u7pdKwkDKQYVluMHgM6wRcyvLRCos= -github.com/augustbleeds/libocr v0.0.0-20240112185046-e95ee7bb3d72/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= +github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d h1:L/EuiT9j88wX94xyqJN1/L6FSPZpKVDdj1aYHu7Fs5c= +github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= diff --git a/pkg/loop/internal/datasource.go b/pkg/loop/internal/datasource.go index d3ae22aab..da90b6c42 100644 --- a/pkg/loop/internal/datasource.go +++ b/pkg/loop/internal/datasource.go @@ -2,7 +2,6 @@ package internal import ( "context" - "errors" "math/big" "google.golang.org/grpc" @@ -27,13 +26,11 @@ func (d *dataSourceClient) Observe(ctx context.Context, timestamp types.ReportTi reply, err := d.grpc.Observe(ctx, &pb.ObserveRequest{ ReportTimestamp: pbReportTimestamp(timestamp), }) - // return nil value for NOOP (only affects gas price data source) - if errors.Is(err, median.ErrNOOPDataSource) { - return nil, nil - } + if err != nil { return nil, err } + return reply.Value.Int(), nil } @@ -52,11 +49,6 @@ func (d *dataSourceServer) Observe(ctx context.Context, request *pb.ObserveReque } val, err := d.impl.Observe(ctx, timestamp) - // return nil value for NOOP (only affects gas price data source) - if errors.Is(err, median.ErrNOOPDataSource) { - return &pb.ObserveReply{Value: nil}, nil - } - if err != nil { return nil, err } diff --git a/pkg/loop/internal/test/datasource.go b/pkg/loop/internal/test/datasource.go index f4090dae5..3b133788e 100644 --- a/pkg/loop/internal/test/datasource.go +++ b/pkg/loop/internal/test/datasource.go @@ -32,5 +32,5 @@ type NOOPDataSource struct { } func (s NOOPDataSource) Observe(ctx context.Context, _ types.ReportTimestamp) (*big.Int, error) { - return nil, median.ErrNOOPDataSource + return nil, nil } diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index 7d77f8d41..d9482579e 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -3,7 +3,6 @@ package test import ( "bytes" "context" - "errors" "fmt" "math/big" "reflect" @@ -236,12 +235,12 @@ func (s StaticPluginMedian) NewMedianFactory(ctx context.Context, provider types return nil, fmt.Errorf("expected JuelsPerFeeCoin %s but got %s", juelsPerFeeCoin, gotJuels) } gotGas, err := gasPriceDataSource.Observe(ctx, reportContext.ReportTimestamp) - // account for noop gas price data source - if err != nil && !errors.Is(err, median.ErrNOOPDataSource) { - return nil, fmt.Errorf("failed to observe juelsPerFeeCoin: %w", err) + if err != nil { + return nil, fmt.Errorf("failed to observe GasPriceSubUnitDataSource: %w", err) } + // value may be nil due to no-op if gotGas != nil && !assert.ObjectsAreEqual(gasPrice, gotGas) { - return nil, fmt.Errorf("expected JuelsPerFeeCoin %s but got %s", juelsPerFeeCoin, gotJuels) + return nil, fmt.Errorf("expected GasPriceSubUnitDataSource %s but got %s", gasPrice, gotGas) } if err := errorLog.SaveError(ctx, errMsg); err != nil { return nil, fmt.Errorf("failed to save error: %w", err) From 083782988e959d0d32b925b60b2c07da15e74572 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Mon, 22 Jan 2024 10:41:20 -0500 Subject: [PATCH 10/15] refactor tests --- pkg/loop/median_service_test.go | 100 +++++++++++++------------------- 1 file changed, 41 insertions(+), 59 deletions(-) diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index d54982b00..797cf860b 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -11,70 +11,52 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" + "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" ) func TestMedianService(t *testing.T) { t.Parallel() - median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { - return NewHelperProcessCommand(loop.PluginMedianName) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.StaticGasPriceDataSource(), &test.StaticErrorLog{}) - hook := median.PluginService.XXXTestHook() - servicetest.Run(t, median) - - t.Run("control", func(t *testing.T) { - test.ReportingPluginFactory(t, median) - }) - - t.Run("Kill", func(t *testing.T) { - hook.Kill() - - // wait for relaunch - time.Sleep(2 * internal.KeepAliveTickDuration) - - test.ReportingPluginFactory(t, median) - }) - - t.Run("Reset", func(t *testing.T) { - hook.Reset() - - // wait for relaunch - time.Sleep(2 * internal.KeepAliveTickDuration) - - test.ReportingPluginFactory(t, median) - }) -} - -func TestMedianServiceNOOPGasPriceDataSource(t *testing.T) { - t.Parallel() - - median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { - return NewHelperProcessCommand(loop.PluginMedianName) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.NOOPDataSource{}, &test.StaticErrorLog{}) - hook := median.PluginService.XXXTestHook() - servicetest.Run(t, median) - - t.Run("control", func(t *testing.T) { - test.ReportingPluginFactory(t, median) - }) - - t.Run("Kill", func(t *testing.T) { - hook.Kill() - - // wait for relaunch - time.Sleep(2 * internal.KeepAliveTickDuration) - - test.ReportingPluginFactory(t, median) - }) - - t.Run("Reset", func(t *testing.T) { - hook.Reset() - - // wait for relaunch - time.Sleep(2 * internal.KeepAliveTickDuration) - - test.ReportingPluginFactory(t, median) - }) + for _, tt := range []struct { + name string + gasPriceDataSource median.DataSource + }{ + {"static", test.StaticGasPriceDataSource()}, + {"noop", test.NOOPDataSource{}}, + } { + tt := tt + t.Run(tt.name, func(t *testing.T) { + t.Parallel() + + median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { + return NewHelperProcessCommand(loop.PluginMedianName) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), tt.gasPriceDataSource, &test.StaticErrorLog{}) + hook := median.PluginService.XXXTestHook() + servicetest.Run(t, median) + + t.Run("control", func(t *testing.T) { + test.ReportingPluginFactory(t, median) + }) + + t.Run("Kill", func(t *testing.T) { + hook.Kill() + + // wait for relaunch + time.Sleep(2 * internal.KeepAliveTickDuration) + + test.ReportingPluginFactory(t, median) + }) + + t.Run("Reset", func(t *testing.T) { + hook.Reset() + + // wait for relaunch + time.Sleep(2 * internal.KeepAliveTickDuration) + + test.ReportingPluginFactory(t, median) + }) + }) + } } func TestMedianService_recovery(t *testing.T) { From cb35a6892a4f2bfb62dfd91bea3c50378ec42ad4 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 21 Feb 2024 14:38:05 -0500 Subject: [PATCH 11/15] change noop to return 0 --- pkg/loop/internal/test/datasource.go | 2 +- pkg/loop/internal/test/median.go | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/loop/internal/test/datasource.go b/pkg/loop/internal/test/datasource.go index 3b133788e..55f67fc35 100644 --- a/pkg/loop/internal/test/datasource.go +++ b/pkg/loop/internal/test/datasource.go @@ -32,5 +32,5 @@ type NOOPDataSource struct { } func (s NOOPDataSource) Observe(ctx context.Context, _ types.ReportTimestamp) (*big.Int, error) { - return nil, nil + return big.NewInt(0), nil } diff --git a/pkg/loop/internal/test/median.go b/pkg/loop/internal/test/median.go index e13b18c2e..35f7933a6 100644 --- a/pkg/loop/internal/test/median.go +++ b/pkg/loop/internal/test/median.go @@ -238,8 +238,7 @@ func (s StaticPluginMedian) NewMedianFactory(ctx context.Context, provider types if err != nil { return nil, fmt.Errorf("failed to observe GasPriceSubUnitDataSource: %w", err) } - // value may be nil due to no-op - if gotGas != nil && !assert.ObjectsAreEqual(gasPrice, gotGas) { + if !assert.ObjectsAreEqual(gasPrice, gotGas) { return nil, fmt.Errorf("expected GasPriceSubUnitDataSource %s but got %s", gasPrice, gotGas) } if err := errorLog.SaveError(ctx, errMsg); err != nil { From d57e9a80fcaaee73fe7c65ecd1d83afe9841bf48 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Wed, 21 Feb 2024 16:08:41 -0500 Subject: [PATCH 12/15] try both static and noop --- pkg/loop/internal/test/datasource.go | 4 ++-- pkg/loop/median_service_test.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/loop/internal/test/datasource.go b/pkg/loop/internal/test/datasource.go index 55f67fc35..8a2ea16be 100644 --- a/pkg/loop/internal/test/datasource.go +++ b/pkg/loop/internal/test/datasource.go @@ -31,6 +31,6 @@ func (s *staticDataSource) Observe(ctx context.Context, timestamp types.ReportTi type NOOPDataSource struct { } -func (s NOOPDataSource) Observe(ctx context.Context, _ types.ReportTimestamp) (*big.Int, error) { - return big.NewInt(0), nil +func (s *NOOPDataSource) Observe(ctx context.Context, _ types.ReportTimestamp) (*big.Int, error) { + return big.NewInt(1), nil } diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index ef2d256ef..a771f3693 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -22,15 +22,14 @@ func TestMedianService(t *testing.T) { gasPriceDataSource median.DataSource }{ {"static", test.StaticGasPriceDataSource()}, - {"noop", test.NOOPDataSource{}}, + {"noop", &test.NOOPDataSource{}}, } { tt := tt t.Run(tt.name, func(t *testing.T) { - t.Parallel() median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { return NewHelperProcessCommand(loop.PluginMedianName, false) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), &test.StaticErrorLog{}) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), tt.gasPriceDataSource, &test.StaticErrorLog{}) hook := median.PluginService.XXXTestHook() servicetest.Run(t, median) From c9277a35bb2f8dfa46b2ce045a31ff24476dc5d2 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 22 Feb 2024 10:23:42 -0500 Subject: [PATCH 13/15] fix test --- pkg/loop/internal/test/datasource.go | 2 +- pkg/loop/median_service_test.go | 54 +++++++++++----------------- 2 files changed, 21 insertions(+), 35 deletions(-) diff --git a/pkg/loop/internal/test/datasource.go b/pkg/loop/internal/test/datasource.go index 8a2ea16be..a108e1128 100644 --- a/pkg/loop/internal/test/datasource.go +++ b/pkg/loop/internal/test/datasource.go @@ -32,5 +32,5 @@ type NOOPDataSource struct { } func (s *NOOPDataSource) Observe(ctx context.Context, _ types.ReportTimestamp) (*big.Int, error) { - return big.NewInt(1), nil + return big.NewInt(0), nil } diff --git a/pkg/loop/median_service_test.go b/pkg/loop/median_service_test.go index a771f3693..e115e2f36 100644 --- a/pkg/loop/median_service_test.go +++ b/pkg/loop/median_service_test.go @@ -11,51 +11,37 @@ import ( "github.com/smartcontractkit/chainlink-common/pkg/loop/internal" "github.com/smartcontractkit/chainlink-common/pkg/loop/internal/test" "github.com/smartcontractkit/chainlink-common/pkg/services/servicetest" - "github.com/smartcontractkit/libocr/offchainreporting2/reportingplugin/median" ) func TestMedianService(t *testing.T) { t.Parallel() + median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { + return NewHelperProcessCommand(loop.PluginMedianName, false) + }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), test.StaticGasPriceDataSource(), &test.StaticErrorLog{}) + hook := median.PluginService.XXXTestHook() + servicetest.Run(t, median) - for _, tt := range []struct { - name string - gasPriceDataSource median.DataSource - }{ - {"static", test.StaticGasPriceDataSource()}, - {"noop", &test.NOOPDataSource{}}, - } { - tt := tt - t.Run(tt.name, func(t *testing.T) { - t.Parallel() - median := loop.NewMedianService(logger.Test(t), loop.GRPCOpts{}, func() *exec.Cmd { - return NewHelperProcessCommand(loop.PluginMedianName, false) - }, test.StaticMedianProvider{}, test.StaticDataSource(), test.StaticJuelsPerFeeCoinDataSource(), tt.gasPriceDataSource, &test.StaticErrorLog{}) - hook := median.PluginService.XXXTestHook() - servicetest.Run(t, median) - - t.Run("control", func(t *testing.T) { - test.ReportingPluginFactory(t, median) - }) + t.Run("control", func(t *testing.T) { + test.ReportingPluginFactory(t, median) + }) - t.Run("Kill", func(t *testing.T) { - hook.Kill() + t.Run("Kill", func(t *testing.T) { + hook.Kill() - // wait for relaunch - time.Sleep(2 * internal.KeepAliveTickDuration) + // wait for relaunch + time.Sleep(2 * internal.KeepAliveTickDuration) - test.ReportingPluginFactory(t, median) - }) + test.ReportingPluginFactory(t, median) + }) - t.Run("Reset", func(t *testing.T) { - hook.Reset() + t.Run("Reset", func(t *testing.T) { + hook.Reset() - // wait for relaunch - time.Sleep(2 * internal.KeepAliveTickDuration) + // wait for relaunch + time.Sleep(2 * internal.KeepAliveTickDuration) - test.ReportingPluginFactory(t, median) - }) - }) - } + test.ReportingPluginFactory(t, median) + }) } func TestMedianService_recovery(t *testing.T) { From 9346ac97af8f569105964ac275c22d61a5234f95 Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 22 Feb 2024 10:39:44 -0500 Subject: [PATCH 14/15] point to new libocr --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 44b0ce482..046801e6c 100644 --- a/go.mod +++ b/go.mod @@ -78,7 +78,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a replace ( // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 diff --git a/go.sum b/go.sum index 0e811c04f..2d90ffd93 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.9.4 h1:mnUj0ivWy6UzbB1uLFqKR6F+ZyiDc7j4iGgHTpO+5+I= github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d h1:L/EuiT9j88wX94xyqJN1/L6FSPZpKVDdj1aYHu7Fs5c= -github.com/augustbleeds/libocr v0.0.0-20240117214314-b678c2c6c62d/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= +github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a h1:G+0vnO8YmDuHmys68k3vBn95XpdJM8H9pHNfyRP9hpo= +github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA= From b6579c9a72fe996b08707b186e9d423d5cbd769f Mon Sep 17 00:00:00 2001 From: Augustus Chang Date: Thu, 22 Feb 2024 10:54:20 -0500 Subject: [PATCH 15/15] update libocr --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 046801e6c..e2cc9eb79 100644 --- a/go.mod +++ b/go.mod @@ -78,7 +78,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a +replace github.com/smartcontractkit/libocr => github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800 replace ( // until merged upstream: https://github.com/hashicorp/go-plugin/pull/257 diff --git a/go.sum b/go.sum index 2d90ffd93..cfd73c757 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Microsoft/hcsshim v0.9.4 h1:mnUj0ivWy6UzbB1uLFqKR6F+ZyiDc7j4iGgHTpO+5+I= github.com/Microsoft/hcsshim v0.9.4/go.mod h1:7pLA8lDk46WKDWlVsENo92gC0XFa8rbKfyFRBqxEbCc= -github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a h1:G+0vnO8YmDuHmys68k3vBn95XpdJM8H9pHNfyRP9hpo= -github.com/augustbleeds/libocr v0.0.0-20240215150045-fe2ba71b2f0a/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= +github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800 h1:eXMkGNE9kfAYyAEBlzjL53ax4klanSS+v4zOhNfuE2M= +github.com/augustbleeds/libocr v0.0.0-20240222154448-6050883e1800/go.mod h1:kC0qmVPUaVkFqGiZMNhmRmjdphuUmeyLEdlWFOQzFWI= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bufbuild/protocompile v0.4.0 h1:LbFKd2XowZvQ/kajzguUp2DC9UEIQhIq77fZZlaQsNA=