Repository navigation
Gasmeter: log workflowID + fault injection tests - #829
Draft
DylanTinianov wants to merge 5 commits into
Draft
DylanTinianov wants to merge 5 commits into
DylanTinianov wants to merge 5 commits into
Conversation
…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>
|
There was a problem hiding this comment.
🔵 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
workflowIDto the emission log contract and its existing test. - Adds tests for fee perturbation and dropped usage records.
- Updates
chainlink-commonand 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
…flowid Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ink-common Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cedric-cordenier
previously approved these changes
Oct 28, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.





The
Emitted capability usage meter recordlog line is a contract consumed by the emit reconciler, which builds the billing event idcre: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 noworkflowID. It does now; every existing field is unchanged.Usage fault injection (
resourcemanager.UsageFaultInjection, added in smartcontractkit/chainlink-common#2479) is configured on the sharedResourceManagerConfigand delivered to LOOP plugins through the metering env config, so it reaches the gas meter with no code change here.gasmeter_fault_test.goproves 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-commonis bumped past it inchain_capabilities/common,evmandsolana.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 recordline carriedworkflowID, the reported fee equalledgasUsed × effectiveGasPricefrom 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.