Repository navigation
config: add [Metering].CapabilityUsageEnabled gate for workflow usage MeterRecords (CRE-6778) - #23857
Closed
DylanTinianov wants to merge 1 commit into
Closed
DylanTinianov wants to merge 1 commit into
DylanTinianov wants to merge 1 commit into
Conversation
… MeterRecords Per-capability workflow billing (CRE-6778) adds METER_ACTION_USAGE records for compute duration and gas at every capability that bills a workflow execution. This setting is the single switch for all of those emission points, default false, so DONs can be moved to the new records one at a time and rolled back without a redeploy of the emitters. It is independent of MeterRecordsEnabled, which gates durable resource metering (active workflow specs) and must not be coupled to this rollout. Passed to LOOP capability plugins as CL_CAPABILITY_USAGE_ENABLED. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The generated docs/CONFIG.md remains stale and omits the new operator-facing setting.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Risk Rating: LOW — Adds a disabled-by-default configuration gate with focused plumbing and tests.
Introduces a per-DON capability-usage metering gate and forwards it to LOOP plugins.
Changes:
- Adds
CapabilityUsageEnabledacross TOML, interfaces, defaults, fixtures, and tests. - Enables the gate for local CRE worker nodes.
- Updates
chainlink-commonfor the correspondingEnvConfigfield.
Human review focus: Verify the chainlink-common LOOP environment contract and regenerated configuration documentation.
| File | Description |
|---|---|
go.mod |
Updates chainlink-common. |
go.sum |
Updates dependency checksums. |
plugins/loop_registry.go |
Passes the gate to LOOP plugins. |
plugins/loop_registry_test.go |
Tests LOOP propagation. |
core/config/metering_config.go |
Extends the metering interface. |
core/config/toml/types.go |
Adds the TOML field and merge behavior. |
core/config/docs/core.toml |
Defines the documented default. |
core/services/chainlink/config_metering.go |
Exposes the resolved value. |
core/services/chainlink/config_metering_test.go |
Tests default and explicit values. |
core/services/chainlink/config_test.go |
Covers configuration marshaling. |
core/services/chainlink/testdata/config-full.toml |
Adds the enabled fixture value. |
core/services/chainlink/testdata/config-empty-effective.toml |
Adds the default fixture value. |
core/services/chainlink/testdata/config-multi-chain-effective.toml |
Adds the default fixture value. |
core/web/resolver/testdata/config-full.toml |
Updates resolver fixture output. |
core/web/resolver/testdata/config-empty-effective.toml |
Updates resolver default output. |
core/web/resolver/testdata/config-multi-chain-effective.toml |
Updates resolver multichain output. |
system-tests/lib/cre/don/config/config.go |
Enables usage metering locally. |
system-tests/lib/cre/don/config/config_test.go |
Tests local enablement. |
system-tests/lib/go.mod |
Updates chainlink-common. |
system-tests/lib/go.sum |
Updates checksums. |
system-tests/tests/go.mod |
Updates chainlink-common. |
system-tests/tests/go.sum |
Updates checksums. |
system-tests/tests/canaries_sentinels/proof-of-reserve/cron-based/go.mod |
Updates dependencies and Go version. |
system-tests/tests/canaries_sentinels/proof-of-reserve/cron-based/go.sum |
Updates checksums. |
integration-tests/go.mod |
Updates chainlink-common. |
integration-tests/go.sum |
Updates checksums. |
integration-tests/load/go.mod |
Updates chainlink-common. |
integration-tests/load/go.sum |
Updates checksums. |
deployment/go.mod |
Updates chainlink-common. |
deployment/go.sum |
Updates checksums. |
core/scripts/go.mod |
Updates chainlink-common. |
core/scripts/go.sum |
Updates checksums. |
devenv/go.mod |
Updates and tidies dependencies. |
devenv/go.sum |
Updates checksums. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+970
to
+973
| # 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 |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Part of capability-centric, eventually consistent workflow billing (CRE-6778). Config only; nothing emits yet.
What
New node setting, default false:
It is the single switch for every per-capability usage MeterRecord emission point that follows (compute duration in the v2 engine, gas in the EVM/Solana write capabilities). Off means those emitters are never constructed and every emission site is a nil no-op. Node TOML is per DON, so this is the per-DON rollout gate the design doc asks for, and it can be turned off again without redeploying emitters.
Independent of
MeterRecordsEnabled, which gates durable resource metering (active workflow specs) and must not be coupled to this rollout.Plumbing mirrors
MeterSnapshotsEnabled:toml.Metering,config.Meteringinterface,meteringConfigaccessor,core.tomldocs + regenerateddocs/CONFIG.md, config fixtures, andplugins/loop_registry.gopasses it to LOOP plugins asCL_CAPABILITY_USAGE_ENABLED(needs chainlink-commonEnvConfig.CapabilityUsageEnabled). Local CRE node config (system-tests/lib/cre/don/config) turns it on.Depends on
chainlink-common:
EnvConfig.CapabilityUsageEnabled(bumped here).