feat: #2241 add a trace-call matcher for reverted and internal-call triggers - #2393
Open
zkasuran wants to merge 1 commit into
Open
feat: #2241 add a trace-call matcher for reverted and internal-call triggers#2393zkasuran wants to merge 1 commit into
zkasuran wants to merge 1 commit into
Conversation
…al-call triggers eth_getLogs sees only emitted events, so a workflow cannot trigger on a reverted transaction, an internal ETH transfer, a delegatecall into an unlogged implementation, or an unlogged privileged call. The survey in KeeperHub#2247 settled trace-method access, and lib/web3/trace-decode.ts already flattens a callTracer tree into ordered FlatCall frames with correct top-down revert propagation. This adds the match step KeeperHub#2241 names: matchTraceCalls(root, filter) selects flattened frames by caller, callee, selector, call type, minimum value, and success/reverted/any status, plus a callSelector helper. Pure, no network, no Aetherlay change, no new dependency. It is the matching seam a Trace trigger consumes, kept separately shippable while provider access is resolved. Verified: 13-case unit test passes, the existing trace-decode suite is unchanged (31 tests total), tsgo and biome clean.
Contributor
About the
|
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.
Closes #2241 (matching seam; see below for what is deliberately out of scope).
What this does
eth_getLogssees only what a contract chose to emit, so a workflow cannot trigger on a reverted transaction, an internal ETH transfer, adelegatecallinto an unlogged implementation, nor an unlogged privileged call. Those are the highest-value security signals and they are invisible today.The survey in #2247 settled the trace-method access question.
lib/web3/trace-decode.tsalready flattens acallTracertree into orderedFlatCallframes with correct top-down revert propagation. What was missing is the match step #2241 names. This adds it:matchTraceCalls(root, filter)selects flattened frames bycaller,callee,selector,callTypes,minValue, plus astatusofsuccess(default),revertedorany.callSelector(call)returns a frame's 4-byte selector, using0xfor a value-only frame.An empty filter matches every executed frame; each field is a wildcard when unset. Addresses and selectors compare case-insensitively.
Scope
In scope: the pure matcher and its helper, next to the existing decoder. Out of scope, kept separately shippable so this can land while the provider-access question the survey flagged is resolved by a maintainer: wiring a Trace trigger type, block polling, plus any Aetherlay change. No new dependency, no network in the matched path, no schema change.
Verified
tests/unit/trace-match.test.ts: 13 cases covering the default success-only behaviour, a reverted subtree (both frames roll back, matching EVM semantics), value thresholds,delegatecallmatching, selector and caller matching, plus case-insensitivity.tests/unit/trace-decode.test.tsis unchanged and still passes (31 tests across the two files).tsgo --noEmitandbiome checkclean on both files.AI disclosure
AI assistance (Claude, Anthropic) was used in developing this change. The design and verification are the author's. Verified locally before submitting: the two test files above, plus tsgo and biome on the changed files.