-
Notifications
You must be signed in to change notification settings - Fork 0
Analyze Panic error on some paymaster tx's #16
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
base: master
Are you sure you want to change the base?
Analyze Panic error on some paymaster tx's #16
Conversation
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.
Pull request overview
This PR modifies the price feed staleness validation logic in the CrossChainPaymaster contract to prevent underflow reverts when oracle timestamps are in the future. While it addresses the underflow issue by adding a block.timestamp > tUpdated check, it inadvertently introduces a critical security vulnerability by allowing future timestamps to pass validation.
Key changes:
- Updated token price feed staleness check to use short-circuit evaluation to prevent underflow
- Updated ROSE price feed staleness check with the same pattern
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
matevz
left a 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.
rUpdated and tUpdated can't be in the future. I'd revert immediately, if that's the case.
edit: I was in my mind that block is from the block which is from the other chain, but true it's block from sapphire. 🤦♂️ |
d2a725d to
ecf6521
Compare
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.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
after updating the contract with the future timestamp check. It is now clear the panic was because of it. The relayer now retries if this happens, but this should probably be fixed in the price oracle. |
@kostko will have move insights, but I think the The paymaster transactions are not triggered by the events, but can happen to be in the same block as the price feed updates. So |
yes |
investigated further what produces the panic error:
edit: the panic was because of the timestamp difference see #16 (comment)