-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Unable to decode event Instruction: X
#2827
Comments
It's most likely not the intended behavior if it always throws.
We're essentially parsing the logs so I think it's possible to spoof it, but if you'd like to avoid that, there is |
Oh thanks for this. I saw that feature but based on original docs assumed its only used to guarantee its available when logs are truncated. If that is far more secure then would certainly opt for it. Assuming it can be parsed with the Anchor event parser in a similar way or it needs to be parsed differently? |
It needs to be parsed differently because it's not log based like the normal events. Here is an example: anchor/tests/events/tests/events.ts Lines 58 to 62 in 216b56e
|
Thanks a lot this is much appreciated, indeed the event in the tx data looks a lot more secure than just parsing logs. One final question. Is checking the innerInstructions and ensuring |
Yes, checking those accounts should be enough because the event authority needs to "sign" to make self-CPI work.
They shouldn't be able to do this because of the same reason above, the event authority needs to "sign" the invocation. We also have a test for this case: anchor/tests/events/tests/events.ts Lines 69 to 101 in 216b56e
|
When using event parsers
parseLogs
iferrorOnDecodeFailure
is set totrue
the parser throws on the very first log which is alwaysProgram logged: "Instruction: X"
,X
being whatever instruction is being executed. Is this an intended feature?Additionally is it possible for another program to spoof the logs pretending to be a different program we're interested in?
The text was updated successfully, but these errors were encountered: