Skip to content

Gasmeter: log workflowID + fault injection tests - #829

Draft
DylanTinianov wants to merge 5 commits into
mainfrom
CRE-6809-gas-log-workflowid
Draft

DylanTinianov wants to merge 5 commits into
mainfrom
CRE-6809-gas-log-workflowid

Conversation

@DylanTinianov

@DylanTinianov DylanTinianov commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

The Emitted capability usage meter record log line is a contract consumed by the emit reconciler, which builds the billing event id cre:workflow:<workflow_id>:<execution_id>:<tx_hash> from it. The gas meter's logger has no execution scope, so unlike the engine's compute line this one carried no workflowID. It does now; every existing field is unchanged.

Usage fault injection (resourcemanager.UsageFaultInjection, added in smartcontractkit/chainlink-common#2479) is configured on the shared ResourceManagerConfig and delivered to LOOP plugins through the metering env config, so it reaches the gas meter with no code change here. gasmeter_fault_test.go proves it: a perturb config shifts the emitted fee by the delta, a drop config emits nothing.

Depends on smartcontractkit/chainlink-common#2479: the new test compiles only once chainlink-common is bumped past it in chain_capabilities/common, evm and solana.

Tested locally

Local CRE with this branch's EVM capability built and injected into the nodes and the proof-of-reserve cron workflow writing on chain: the Emitted capability usage meter record line carried workflowID, the reported fee equalled gasUsed × effectiveGasPrice from the receipt, and with [Metering.FaultInjection] set on the host the gas records on the selected nodes carried the delta with no change in this repo beyond the dependency bump.

DylanTinianov and others added 2 commits October 20, 2026 11:08
…test (CRE-6809)

The "Emitted capability usage meter record" line gains workflowID so the emit
reconciler can build the billing event id without a sibling line. Bumps
chainlink-common and adds a test showing usage fault injection reaches the gas
meter through the metering config.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ch head

Picks up the usage fault injector so the gas meter test that exercises it
compiles.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@cl-sonarqube-production

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Consumer dependency pins still omit the logging fix, and the open draft fault-injection dependency needs cross-module compatibility validation.

1 open issue
What changed in this PR

This PR adds workflow identity to gas-meter emission logs so the billing reconciler can construct event IDs, and adds tests for shared usage fault injection.

Changes:

  • Adds workflowID to the emission log contract and its existing test.
  • Adds tests for fee perturbation and dropped usage records.
  • Updates chainlink-common and CRE protobuf dependencies across common, EVM, and Solana.
File Description
chain_capabilities/​solana/​go.sum Updates dependency checksums.
chain_capabilities/​solana/​go.mod Updates shared dependencies for Solana.
chain_capabilities/​evm/​go.sum Updates dependency checksums.
chain_capabilities/​evm/​go.mod Updates shared dependencies for EVM.
chain_capabilities/​common/​go.sum Updates dependency checksums.
chain_capabilities/​common/​go.mod Updates dependencies supporting fault injection.
chain_capabilities/​common/​gasmeter/​gasmeter.go Adds workflowID to emission logs and documents the field.
chain_capabilities/​common/​gasmeter/​gasmeter_test.go Asserts the logged workflow ID.
chain_capabilities/​common/​gasmeter/​gasmeter_fault_test.go Tests perturb and drop behavior.

Review effort: Balanced

Comment thread chain_capabilities/common/gasmeter/gasmeter.go
DylanTinianov and others added 2 commits October 27, 2026 12:34
…flowid

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ink-common

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@DylanTinianov DylanTinianov changed the title gasmeter: log workflowID on the usage emission line; prove fault injection reaches the gas meter Gasmeter log workflowID + fault injection tests Oct 27, 2026
@DylanTinianov DylanTinianov changed the title Gasmeter log workflowID + fault injection tests Gasmeter: log workflowID + fault injection tests Oct 27, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants