-
Notifications
You must be signed in to change notification settings - Fork 7
[ADHOC] filter decoded logs using action step signature #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 0191f89 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR 💥 An error occurred when fetching the changed packages and changesets in this PR |
WalkthroughAdds a changeset note declaring a patch release. Updates EventAction.isActionStepValid to filter event logs using the action step’s signature instead of computing the event selector. No public APIs or types changed. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Caller
participant EventAction
participant Provider as Chain Provider
Caller->>EventAction: isActionStepValid(step, txReceipt)
EventAction->>Provider: Retrieve logs from txReceipt
Note over EventAction: NEW: Filter logs where topics[0] === step.signature
alt Matching logs found
EventAction->>EventAction: Decode matching logs
EventAction->>Caller: Return validity result
else No matches
EventAction->>Caller: Return invalid (no matching event)
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
1 similar comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/sdk/src/Actions/EventAction.ts (2)
616-616: Apply the same signature-based filtering for consistency.This line still computes the event selector from the ABI using
toEventSelector(event), but the PR's objective is to use the signature directly. Thesignaturevariable is already available at line 568, so this should be updated for consistency with the change at line 780.Apply this diff:
- decodedLogs = receipt.logs - .filter((log) => log.topics[0] === toEventSelector(event)) - .map((log) => decodeAndReorderLogArgs(event, log)); + decodedLogs = receipt.logs + .filter((log) => log.topics[0] === signature) + .map((log) => decodeAndReorderLogArgs(event, log));
1366-1366: Apply the same signature-based filtering for consistency.This line still computes the event selector from the ABI using
toEventSelector(event), but the PR's objective is to use the signature directly. Thesignaturevariable is already available at line 1323, so this should be updated for consistency with the change at line 780.Apply this diff:
- const decodedLogs = receipt.logs - .filter((log) => log.topics[0] === toEventSelector(event)) - .map((log) => decodeAndReorderLogArgs(event, log)); + const decodedLogs = receipt.logs + .filter((log) => log.topics[0] === signature) + .map((log) => decodeAndReorderLogArgs(event, log));
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.changeset/early-keys-sort.md(1 hunks)packages/sdk/src/Actions/EventAction.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Use Case Tests / Use Case Tests
- GitHub Check: Verify / Verify
🔇 Additional comments (2)
.changeset/early-keys-sort.md (1)
1-5: LGTM!The changeset correctly declares a patch release with an appropriate description of the change.
packages/sdk/src/Actions/EventAction.ts (1)
780-780: LGTM! Change aligns with PR objective.Using the action step's signature directly instead of computing it from the ABI enables working with events that don't have an available ABI.
Description
See screenshot for example. We can derive the types from this and create a pseudo abi, but when you use
toEventSignaturethe hash is the result of the event name + the param types. Since we do not know the event name in this case we cannot derive the correct hash, but since we know what the hash is already (topic0) we can use it directly.Summary by CodeRabbit
Bug Fixes
Chores