fix: return error in SigVerificationDecorator to avoid panic#28
fix: return error in SigVerificationDecorator to avoid panic#28
SigVerificationDecorator to avoid panic#28Conversation
WalkthroughThe changes refactor the balance and signer validation logic in the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SigVerificationDecorator
participant Account
participant NextAnteHandler
Client->>SigVerificationDecorator: AnteHandle(request)
SigVerificationDecorator->>Account: Check if signer matches address
alt Signer does not match
SigVerificationDecorator->>NextAnteHandler: Delegate AnteHandle
else Signer matches
SigVerificationDecorator->>Account: Fetch balance
alt Balance is zero
SigVerificationDecorator->>Client: Return ErrInvalidAccountBalance
else Balance is non-zero
SigVerificationDecorator->>NextAnteHandler: Call AnteHandle
end
end
Suggested reviewers
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
⏰ Context from checks skipped due to timeout of 90000ms (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
SigVerificationDecorator to avoid panic
In the current ante implementation, if the account considered as signer is a Forwarding account, and it does not have a balance, a panic is triggered during signerless registration. This panic is recovered, so does not cause liveness issues, but can be quickly fixed.
The error returned is reported here to keep track of it in case it can be of any help in the future:
Summary by CodeRabbit