Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/config/docs/core.toml
Original file line number Diff line number Diff line change
Expand Up @@ -967,6 +967,10 @@ MeterRecordsEnabled = false # Default
# MeterSnapshotsEnabled enables durable MeterSnapshot emission for LOOP plugins.
# Requires MeterRecordsEnabled = true.
MeterSnapshotsEnabled = false # Default
# CapabilityUsageEnabled enables per-capability workflow usage MeterRecords (compute duration, gas per chain write)
# for eventually consistent billing. Off by default; enable per DON once the billing service accepts capability usage records.
# Independent of MeterRecordsEnabled.
CapabilityUsageEnabled = false # Default
Comment on lines +970 to +973
# Product is the deployment product identity dimension, e.g. 'cre'.
Product = 'cre' # Default
# Tenant is the human-readable tenant name, e.g. 'mainline'.
Expand Down
1 change: 1 addition & 0 deletions core/config/metering_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package config
type Metering interface {
MeterRecordsEnabled() bool
MeterSnapshotsEnabled() bool
CapabilityUsageEnabled() bool
Product() string
Tenant() string
NumericTenantID() string
Expand Down
7 changes: 7 additions & 0 deletions core/config/toml/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3208,6 +3208,10 @@ type Metering struct {
// MeterSnapshotsEnabled enables durable MeterSnapshot emission. Requires
// MeterRecordsEnabled to be true.
MeterSnapshotsEnabled *bool
// CapabilityUsageEnabled enables per-capability workflow usage MeterRecords
// (compute duration, gas) for eventually consistent billing. Independent of
// MeterRecordsEnabled.
CapabilityUsageEnabled *bool
// Product is the deployment product identity dimension, e.g. "cre".
Product *string
// Tenant is the human-readable tenant name, e.g. "mainline".
Expand All @@ -3230,6 +3234,9 @@ func (b *Metering) setFrom(f *Metering) {
if v := f.MeterSnapshotsEnabled; v != nil {
b.MeterSnapshotsEnabled = v
}
if v := f.CapabilityUsageEnabled; v != nil {
b.CapabilityUsageEnabled = v
}
if v := f.Product; v != nil {
b.Product = v
}
Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ require (
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chain-selectors v1.0.111
github.com/smartcontractkit/chainlink-ccip/chains/evm v0.0.0-20260916222901-720a003dab50
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260928161532-9b1062f5076f
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260929173517-9b19176347e4
github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d
github.com/smartcontractkit/chainlink-deployments-framework v0.122.2
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260917132551-2a2b38e8b744
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions core/services/chainlink/config_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ func (b *meteringConfig) MeterSnapshotsEnabled() bool {
return *b.s.MeterSnapshotsEnabled
}

func (b *meteringConfig) CapabilityUsageEnabled() bool {
if b.s.CapabilityUsageEnabled == nil {
return false
}
return *b.s.CapabilityUsageEnabled
}

// Product returns the deployment product identity dimension. The parsed config
// defaults it to "cre" via docs.CoreDefaults so metering is never enabled with
// an empty product dimension; a zero-value toml.Metering that has not been run
Expand Down
19 changes: 11 additions & 8 deletions core/services/chainlink/config_metering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestMeteringConfig(t *testing.T) {
mc := meteringConfig{s: toml.Metering{}}
assert.False(t, mc.MeterRecordsEnabled())
assert.False(t, mc.MeterSnapshotsEnabled())
assert.False(t, mc.CapabilityUsageEnabled())
// A zero-value toml.Metering (not run through setDefaults) has a nil
// Product pointer, so Product() returns "unset". The parsed config
// applies a "cre" default via docs.CoreDefaults (covered by the
Expand All @@ -31,17 +32,19 @@ func TestMeteringConfig(t *testing.T) {
t.Run("explicit values", func(t *testing.T) {
t.Parallel()
mc := meteringConfig{s: toml.Metering{
MeterRecordsEnabled: new(true),
MeterSnapshotsEnabled: new(true),
Product: new("cre"),
Tenant: new("mainline"),
NumericTenantID: new("42"),
Environment: new("production"),
Zone: new("wf-zone-a"),
NodeID: new("clp-cre-wf-zone-a-1"),
MeterRecordsEnabled: new(true),
MeterSnapshotsEnabled: new(true),
CapabilityUsageEnabled: new(true),
Product: new("cre"),
Tenant: new("mainline"),
NumericTenantID: new("42"),
Environment: new("production"),
Zone: new("wf-zone-a"),
NodeID: new("clp-cre-wf-zone-a-1"),
}}
assert.True(t, mc.MeterRecordsEnabled())
assert.True(t, mc.MeterSnapshotsEnabled())
assert.True(t, mc.CapabilityUsageEnabled())
assert.Equal(t, "cre", mc.Product())
assert.Equal(t, "mainline", mc.Tenant())
assert.Equal(t, "42", mc.NumericTenantID())
Expand Down
17 changes: 9 additions & 8 deletions core/services/chainlink/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,15 @@ func TestConfig_Marshal(t *testing.T) {
},
}
full.Metering = toml.Metering{
MeterRecordsEnabled: new(true),
MeterSnapshotsEnabled: new(true),
Product: new("cre"),
Tenant: new("mainline"),
NumericTenantID: new("42"),
Environment: new("production"),
Zone: new("wf-zone-a"),
NodeID: new("clp-cre-wf-zone-a-1"),
MeterRecordsEnabled: new(true),
MeterSnapshotsEnabled: new(true),
CapabilityUsageEnabled: new(true),
Product: new("cre"),
Tenant: new("mainline"),
NumericTenantID: new("42"),
Environment: new("production"),
Zone: new("wf-zone-a"),
NodeID: new("clp-cre-wf-zone-a-1"),
}
full.CRE = toml.CreConfig{
UseLocalTimeProvider: new(true),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ Prefixes = ['go_']
[Metering]
MeterRecordsEnabled = false
MeterSnapshotsEnabled = false
CapabilityUsageEnabled = false
Product = 'cre'
Tenant = ''
NumericTenantID = ''
Expand Down
1 change: 1 addition & 0 deletions core/services/chainlink/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ Prefixes = ['ocr_']
[Metering]
MeterRecordsEnabled = true
MeterSnapshotsEnabled = true
CapabilityUsageEnabled = true
Product = 'cre'
Tenant = 'mainline'
NumericTenantID = '42'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ Prefixes = ['go_']
[Metering]
MeterRecordsEnabled = false
MeterSnapshotsEnabled = false
CapabilityUsageEnabled = false
Product = 'cre'
Tenant = ''
NumericTenantID = ''
Expand Down
1 change: 1 addition & 0 deletions core/web/resolver/testdata/config-empty-effective.toml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ Prefixes = ['go_']
[Metering]
MeterRecordsEnabled = false
MeterSnapshotsEnabled = false
CapabilityUsageEnabled = false
Product = 'cre'
Tenant = ''
NumericTenantID = ''
Expand Down
1 change: 1 addition & 0 deletions core/web/resolver/testdata/config-full.toml
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ Prefixes = ['ocr_']
[Metering]
MeterRecordsEnabled = true
MeterSnapshotsEnabled = true
CapabilityUsageEnabled = true
Product = 'cre'
Tenant = 'mainline'
NumericTenantID = '42'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ Prefixes = ['go_']
[Metering]
MeterRecordsEnabled = false
MeterSnapshotsEnabled = false
CapabilityUsageEnabled = false
Product = 'cre'
Tenant = ''
NumericTenantID = ''
Expand Down
2 changes: 1 addition & 1 deletion deployment/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/smartcontractkit/chainlink-ccip/chains/solana/deployment v0.0.0-20260916222901-720a003dab50
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260916222901-720a003dab50
github.com/smartcontractkit/chainlink-ccip/deployment v0.0.0-20260916222901-720a003dab50
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260928161532-9b1062f5076f
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260929173517-9b19176347e4
github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d
github.com/smartcontractkit/chainlink-data-streams v1.1.1
github.com/smartcontractkit/chainlink-deployments-framework v0.122.2
Expand Down
4 changes: 2 additions & 2 deletions deployment/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 14 additions & 17 deletions devenv/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/smartcontractkit/chainlink/devenv

go 1.26.6
go 1.27.1

require (
github.com/avast/retry-go/v4 v4.7.0
Expand All @@ -12,12 +12,13 @@ require (
github.com/google/go-cmp v0.7.0
github.com/google/uuid v1.6.0
github.com/lib/pq v1.11.1
github.com/moby/moby/client v0.4.1
github.com/onsi/gomega v1.38.2
github.com/pelletier/go-toml/v2 v2.3.1
github.com/pkg/errors v0.9.1
github.com/rs/zerolog v1.35.1
github.com/shopspring/decimal v1.4.0
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260915135448-9ec0150ecb5d
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260929173517-9b19176347e4
github.com/smartcontractkit/chainlink-evm v0.3.4-0.20260519095745-ddfc812d06a0
github.com/smartcontractkit/chainlink-evm/gethwrappers v0.0.0-20251211123524-f0c4fe7cfc0a
github.com/smartcontractkit/chainlink-protos/job-distributor v0.12.0
Expand All @@ -33,19 +34,6 @@ require (
gopkg.in/guregu/null.v4 v4.0.0
)

require (
github.com/Masterminds/semver/v3 v3.5.0 // indirect
github.com/fjl/jsonw v0.1.0 // indirect
github.com/go-openapi/swag/pools v0.28.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/pion/dtls/v3 v3.1.4 // indirect
github.com/pion/stun/v3 v3.1.5 // indirect
github.com/pion/transport/v4 v4.0.2 // indirect
github.com/smartcontractkit/chain-selectors v1.0.104 // indirect
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.53.0 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
)

require (
cloud.google.com/go/auth v0.18.2 // indirect
cloud.google.com/go/auth/oauth2adapt v0.2.8 // indirect
Expand All @@ -59,6 +47,7 @@ require (
github.com/DataDog/zstd v1.5.6 // indirect
github.com/Khan/genqlient v0.8.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.5.0 // indirect
github.com/Masterminds/sprig/v3 v3.3.0 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20251001021608-1fe7b43fc4d6 // indirect
Expand Down Expand Up @@ -139,6 +128,7 @@ require (
github.com/fatih/color v1.18.0 // indirect
github.com/felixge/httpsnoop v1.1.0 // indirect
github.com/ferranbt/fastssz v0.1.4 // indirect
github.com/fjl/jsonw v0.1.0 // indirect
github.com/fsnotify/fsnotify v1.9.0 // indirect
github.com/fxamacker/cbor/v2 v2.9.2 // indirect
github.com/gabriel-vasile/mimetype v1.4.13 // indirect
Expand Down Expand Up @@ -167,6 +157,7 @@ require (
github.com/go-openapi/swag/loading v0.28.0 // indirect
github.com/go-openapi/swag/mangling v0.28.0 // indirect
github.com/go-openapi/swag/netutils v0.28.0 // indirect
github.com/go-openapi/swag/pools v0.28.0 // indirect
github.com/go-openapi/swag/stringutils v0.28.0 // indirect
github.com/go-openapi/swag/typeutils v0.28.0 // indirect
github.com/go-openapi/swag/yamlutils v0.28.0 // indirect
Expand Down Expand Up @@ -231,6 +222,7 @@ require (
github.com/jackc/pgtype v1.14.4 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
github.com/jaegertracing/jaeger-idl v0.6.0 // indirect
github.com/jmoiron/sqlx v1.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/julienschmidt/httprouter v1.3.0 // indirect
Expand Down Expand Up @@ -262,7 +254,6 @@ require (
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/moby/go-archive v0.3.0 // indirect
github.com/moby/moby/api v1.54.2 // indirect
github.com/moby/moby/client v0.4.1
github.com/moby/patternmatcher v0.6.1 // indirect
github.com/moby/spdystream v0.5.1 // indirect
github.com/moby/sys/sequential v0.7.0 // indirect
Expand All @@ -289,7 +280,10 @@ require (
github.com/pb33f/libopenapi-validator v0.13.3 // indirect
github.com/pb33f/ordered-map/v2 v2.3.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pion/dtls/v3 v3.1.4 // indirect
github.com/pion/logging v0.2.4 // indirect
github.com/pion/stun/v3 v3.1.5 // indirect
github.com/pion/transport/v4 v4.0.2 // indirect
github.com/pires/go-proxyproto v0.11.0 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
Expand Down Expand Up @@ -319,14 +313,16 @@ require (
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v4 v4.26.4 // indirect
github.com/sirupsen/logrus v1.9.4 // indirect
github.com/smartcontractkit/chain-selectors v1.0.104 // indirect
github.com/smartcontractkit/chainlink-common/keystore v1.0.2 // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260724142814-45996a1bcb72 // indirect
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92 // indirect
github.com/smartcontractkit/chainlink-framework/chains v0.0.0-20260423135514-5b1a7565a99c // indirect
github.com/smartcontractkit/chainlink-framework/metrics v0.0.0-20260508154216-3ed6f623098f // indirect
github.com/smartcontractkit/chainlink-framework/multinode v0.0.0-20260505202410-b350dca113b4 // indirect
github.com/smartcontractkit/chainlink-protos/cre/go v0.0.0-20260804191526-b7a850ae7648 // indirect
github.com/smartcontractkit/chainlink-protos/linking-service/go v0.0.0-20251002192024-d2ad9222409b // indirect
github.com/smartcontractkit/chainlink-testing-framework/lib/grafana v1.50.0 // indirect
github.com/smartcontractkit/chainlink-testing-framework/wasp v1.53.0 // indirect
github.com/smartcontractkit/freeport v0.1.3-0.20250828155247-add56fa28aad // indirect
github.com/sony/gobreaker/v2 v2.4.0 // indirect
github.com/spf13/cast v1.10.0 // indirect
Expand All @@ -350,6 +346,7 @@ require (
github.com/urfave/cli/v2 v2.27.7 // indirect
github.com/vektah/gqlparser/v2 v2.5.19 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/wlynxg/anet v0.0.5 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
Expand Down
8 changes: 4 additions & 4 deletions devenv/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ require (
github.com/smartcontractkit/chainlink-ccip/chains/solana v0.0.0-20260908155618-50f521d70e62
github.com/smartcontractkit/chainlink-ccip/chains/solana/gobindings v0.0.0-20260908155618-50f521d70e62
github.com/smartcontractkit/chainlink-ccv v0.13.1-0.20260918171034-c93b0d2ef3c0
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260928161532-9b1062f5076f
github.com/smartcontractkit/chainlink-common v0.11.2-0.20260929173517-9b19176347e4
github.com/smartcontractkit/chainlink-common/keystore v1.3.1-0.20260903141829-ef07b52a737d
github.com/smartcontractkit/chainlink-common/pkg/chipingress v0.0.11-0.20260915184316-2730f1867c92
github.com/smartcontractkit/chainlink-data-streams v1.1.1
Expand Down
Loading
Loading