Skip to content

Commit 4aa2bbd

Browse files
committed
Merge branch 'main' of github.com:smartcontractkit/chainlink-common into INFOPLAT-2938-logs-streaming-loopp
2 parents 1f5b7bd + 2b8d634 commit 4aa2bbd

File tree

7 files changed

+202
-7
lines changed

7 files changed

+202
-7
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package types
2+
3+
//go:generate protoc --go_out=. --go_opt=paths=source_relative -I. ocr3_chain_capabilities_config_types.proto

pkg/capabilities/v2/chain-capabilities/consensus/ocr3/types/ocr3_chain_capabilities_config_types.pb.go

Lines changed: 169 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax = "proto3";
2+
3+
option go_package = "capabilities/v2/chain-capabilities/consensus/ocr3/types";
4+
5+
package chain_capabilities_ocr3_config_types;
6+
7+
message ReportingPluginConfig {
8+
// These fields are shadowing the `ReportingPluginLimits` fields.
9+
// See: https://github.com/smartcontractkit/libocr/blob/master/offchainreporting2plus/ocr3types/plugin.go#L296
10+
uint32 maxQueryLengthBytes = 1;
11+
uint32 maxObservationLengthBytes = 2;
12+
uint32 maxOutcomeLengthBytes = 3;
13+
uint32 maxReportLengthBytes = 4;
14+
uint32 maxReportCount = 5;
15+
16+
uint32 maxBatchSize = 6;
17+
}

pkg/chipingress/auth.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var _ credentials.PerRPCCredentials = basicAuthCredentials{}
1111
var _ credentials.PerRPCCredentials = tokenAuthCredentials{}
1212

1313
type HeaderProvider interface {
14-
Headers(ctx context.Context) map[string]string
14+
Headers(ctx context.Context) (map[string]string, error)
1515
}
1616

1717
// Basic-Auth authentication for Chip Ingress
@@ -50,7 +50,7 @@ func (c tokenAuthCredentials) GetRequestMetadata(ctx context.Context, _ ...strin
5050
if c.authTokenProvider == nil {
5151
return nil, nil
5252
}
53-
return c.authTokenProvider.Headers(ctx), nil
53+
return c.authTokenProvider.Headers(ctx)
5454
}
5555

5656
func (c tokenAuthCredentials) RequireTransportSecurity() bool {

pkg/chipingress/auth_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ type testHeaderProvider struct {
5353
headers map[string]string
5454
}
5555

56-
func (p *testHeaderProvider) Headers(ctx context.Context) map[string]string {
57-
return p.headers
56+
func (p *testHeaderProvider) Headers(ctx context.Context) (map[string]string, error) {
57+
return p.headers, nil
5858
}
5959

6060
func TestTokenAuth(t *testing.T) {

pkg/chipingress/client.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ func newHeaderInterceptor(provider HeaderProvider) grpc.UnaryClientInterceptor {
167167
return func(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, invoker grpc.UnaryInvoker, opts ...grpc.CallOption) error {
168168
// Add dynamic headers from provider if available
169169
if provider != nil {
170-
for k, v := range provider.Headers(ctx) {
170+
171+
headers, err := provider.Headers(ctx)
172+
if err != nil {
173+
return fmt.Errorf("failed to get headers: %w", err)
174+
}
175+
176+
for k, v := range headers {
171177
ctx = metadata.AppendToOutgoingContext(ctx, k, v)
172178
}
173179
}

pkg/chipingress/client_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -584,8 +584,8 @@ type mockHeaderProvider struct {
584584
headers map[string]string
585585
}
586586

587-
func (m *mockHeaderProvider) Headers(ctx context.Context) map[string]string {
588-
return m.headers
587+
func (m *mockHeaderProvider) Headers(ctx context.Context) (map[string]string, error) {
588+
return m.headers, nil
589589
}
590590

591591
func TestWithTLS(t *testing.T) {

0 commit comments

Comments
 (0)