Skip to content

Fix inner instruction events not being detected#4451

Merged
swaroop-osec merged 10 commits into
otter-sec:masterfrom
Matthias1590:inner-instruction-event-detection
Jun 11, 2026
Merged

Fix inner instruction events not being detected#4451
swaroop-osec merged 10 commits into
otter-sec:masterfrom
Matthias1590:inner-instruction-event-detection

Conversation

@Matthias1590

@Matthias1590 Matthias1590 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Fixes #4450 by removing the "log:" part of the log check, if a log line starts with Program ${programId.toString()} it belongs to programId, whether it's a log, or invoke.

@vercel

vercel Bot commented Apr 22, 2026

Copy link
Copy Markdown

@Matthias1590 is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

@0x4ka5h 0x4ka5h left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Prefer matching inner invoke with the same regex as the first log and only then push if the captured id equals this program. Also Could you please mirror the change in client/lib.rs and add a small parseLogs test there aswell.

Comment thread ts/packages/anchor/src/program/event.ts Outdated
@Matthias1590

Copy link
Copy Markdown
Contributor Author

Will do

@Matthias1590

Matthias1590 commented Apr 23, 2026

Copy link
Copy Markdown
Contributor Author

Requested changes are made. The added test failed pre-edit and passed afterwards, as expected.

@Matthias1590 Matthias1590 requested a review from 0x4ka5h April 23, 2026 11:58
@Matthias1590

Copy link
Copy Markdown
Contributor Author

Formatting is fixed now

@Matthias1590

Copy link
Copy Markdown
Contributor Author

Will this be merged? Constantly syncing my fork up to date for my projects is getting annoying :p

@Matthias1590

Copy link
Copy Markdown
Contributor Author

Bump

@0x4ka5h 0x4ka5h requested a review from swaroop-osec April 30, 2026 06:33
Comment thread client/src/lib.rs

@swaroop-osec swaroop-osec left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

  • Just needed tests as requested

@jamie-osec IMO we should also make these regexes statics with lazy init (e.g. OnceLock<Regex>), since right now handle_system_log recompiles two regexes on every log line and parse_logs_response / Execution::new each compile their own copy of effectively the same invoke pattern. Four Regex::new(...) call sites total, all the same anchored shape, all compiled on every call.

@Matthias1590

Copy link
Copy Markdown
Contributor Author

Would you mind if regexes get refactored in a separate pr? I can open one for that after this is merged but I'd like for this to be merged ASAP so I can start using actual releases in my projects again

@jamie-osec

Copy link
Copy Markdown
Collaborator

Updated the regexes, including some drive-by changes to other regexes in the same file. It feels like there's some redundancy with those, but fine for now

@jamie-osec

Copy link
Copy Markdown
Collaborator

Filed an issue for improving the test coverage

@swaroop-osec swaroop-osec merged commit 0bc86d6 into otter-sec:master Jun 11, 2026
101 checks passed
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.

Events not being detected in inner instruction logs

4 participants