Skip to content

Commit 3d116df

Browse files
committed
addressed feedback
1 parent 411638d commit 3d116df

File tree

8 files changed

+18
-17
lines changed

8 files changed

+18
-17
lines changed

capabilities/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ toolchain go1.24.3
77
require (
88
github.com/google/uuid v1.6.0
99
github.com/jpillora/backoff v1.0.0
10-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250611184338-e845ca66dba0
10+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250617133454-9f01f00e6ea8
1111
github.com/stretchr/testify v1.10.0
1212
go.opentelemetry.io/otel v1.35.0
1313
go.opentelemetry.io/otel/metric v1.35.0

capabilities/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ github.com/santhosh-tekuri/jsonschema/v5 v5.2.0 h1:WCcC4vZDS1tYNxjWlwRJZQy28r8CM
8989
github.com/santhosh-tekuri/jsonschema/v5 v5.2.0/go.mod h1:FKdcjfQW6rpZSnxxUvEA5H/cDPdvJ/SZJQLWWXWGrZ0=
9090
github.com/shopspring/decimal v1.4.0 h1:bxl37RwXBklmTi0C79JfXCEBD1cqqHt0bbgBAGFp81k=
9191
github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+DMd9qYNcwME=
92-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250611184338-e845ca66dba0 h1:IgP7CRbAAz6d18byQH/4ozrKwHSTa3G9Ut592R6inH4=
93-
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250611184338-e845ca66dba0/go.mod h1:H7gOuN4Jzf+DWllfP5Pb7AiCWBMQrDX1D1KYXAEhdnw=
92+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250617133454-9f01f00e6ea8 h1:b9g3M6Re82Kf82eXWL6OafKzQ/DmGt479zrSvdpVRMM=
93+
github.com/smartcontractkit/chainlink-common v0.7.1-0.20250617133454-9f01f00e6ea8/go.mod h1:1ntZ0rtQpPx6h+xlcOJp0ccqHFaxTzW2Z62FJG358q0=
9494
github.com/smartcontractkit/libocr v0.0.0-20250328171017-609ec10a5510 h1:gm8Jli0sdkrZYnrWBngAkPSDzFDkdNCy1/Dj86kVtYk=
9595
github.com/smartcontractkit/libocr v0.0.0-20250328171017-609ec10a5510/go.mod h1:Mb7+/LC4edz7HyHxX4QkE42pSuov4AV68+AxBXAap0o=
9696
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=

capabilities/writetarget/__debug_bin4176497639

Whitespace-only changes.

capabilities/writetarget/__debug_bin633733685

Whitespace-only changes.

capabilities/writetarget/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import (
66

77
// Config defines the write target component configuration.
88
type Config struct {
9-
ConfirmerPollPeriod time.Duration
10-
ConfirmerTimeout time.Duration
9+
PollPeriod time.Duration
10+
AcceptanceTimeout time.Duration
1111
}
1212

1313
// DefaultConfigSet is the default configuration for the write target component.
1414
var DefaultConfigSet = Config{
15-
ConfirmerPollPeriod: 1 * time.Second,
16-
ConfirmerTimeout: 10 * time.Second,
15+
PollPeriod: 1 * time.Second,
16+
AcceptanceTimeout: 10 * time.Second,
1717
}

capabilities/writetarget/report/platform/processor/processor.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ import (
1111
"github.com/smartcontractkit/chainlink-framework/capabilities/writetarget/monitoring/pb/platform/on-chain/forwarder"
1212
)
1313

14+
const WriteTargetProcessorName = "writetarget"
15+
const KeystoneProcessorName = "keystone"
16+
17+
var PlatformDefaultProcessors = []string{WriteTargetProcessorName, KeystoneProcessorName}
18+
1419
// Product-agnostic processors to be injected into WriteTarget Monitor
1520
func NewPlatformProcessors(emitter beholder.ProtoEmitter) (map[string]beholder.ProtoProcessor, error) {
1621
forwarderMetrics, err := forwarder.NewMetrics()
@@ -33,10 +38,6 @@ func NewPlatformProcessors(emitter beholder.ProtoEmitter) (map[string]beholder.P
3338
}, nil
3439
}
3540

36-
func GetDefaultPlatformProcessors() []string {
37-
return []string{"writetarget", "keystone"}
38-
}
39-
4041
// Write-Target specific processor decodes write messages to derive metrics
4142
type wtProcessor struct {
4243
metrics *wt.Metrics

capabilities/writetarget/write_target.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,12 +369,12 @@ func (c *writeTarget) acceptAndConfirmWrite(ctx context.Context, info requestInf
369369
lggr := logger.Named(c.lggr, "write-confirmer")
370370

371371
// Timeout for the confirmation process
372-
timeout := c.config.ConfirmerTimeout
372+
timeout := c.config.AcceptanceTimeout
373373
ctx, cancel := context.WithTimeout(ctx, timeout)
374374
defer cancel()
375375

376376
// Retry interval for the confirmation process
377-
interval := c.config.ConfirmerPollPeriod
377+
interval := c.config.PollPeriod
378378
ticker := services.NewTicker(interval)
379379
defer ticker.Stop()
380380

@@ -443,7 +443,7 @@ func (c *writeTarget) acceptAndConfirmWrite(ctx context.Context, info requestInf
443443
// Polls transaction status until it reaches one of terminal states [Finalized, Failed, Fatal]
444444
func (c *writeTarget) waitTxReachesTerminalStatus(ctx context.Context, lggr logger.Logger, txID string) (finalized bool, err error) {
445445
// Retry interval for the confirmation process
446-
interval := c.config.ConfirmerPollPeriod
446+
interval := c.config.PollPeriod
447447
ticker := time.NewTicker(interval)
448448
defer ticker.Stop()
449449

capabilities/writetarget/write_target_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ func setupWriteTarget(
4343
if productSpecificProcessor {
4444
platformProcessors["test"] = newMockProductSpecificProcessor(t)
4545
}
46-
monClient, err := writetarget.NewMonitor(writetarget.MonitorOpts{lggr, platformProcessors, processor.GetDefaultPlatformProcessors(), emitter})
46+
monClient, err := writetarget.NewMonitor(writetarget.MonitorOpts{lggr, platformProcessors, processor.PlatformDefaultProcessors, emitter})
4747
require.NoError(t, err)
4848

4949
pollPeriod := 100 * time.Millisecond
@@ -53,8 +53,8 @@ func setupWriteTarget(
5353
opts := writetarget.WriteTargetOpts{
5454
5555
Config: writetarget.Config{
56-
ConfirmerPollPeriod: pollPeriod,
57-
ConfirmerTimeout: timeout,
56+
PollPeriod: pollPeriod,
57+
AcceptanceTimeout: timeout,
5858
},
5959
ChainInfo: monitor.ChainInfo{},
6060
Logger: lggr,

0 commit comments

Comments
 (0)