Skip to content
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

Potential panic from debug_assert #1210

Open
sea212 opened this issue Dec 22, 2023 · 0 comments
Open

Potential panic from debug_assert #1210

sea212 opened this issue Dec 22, 2023 · 0 comments
Assignees
Labels
l:S Solving this issue takes hours p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement

Comments

@sea212
Copy link
Member

sea212 commented Dec 22, 2023

Provided by SRLabs runtime review.

Summary
Multiple pallets are using debug_assert, which can cause a panic or logic errors in the runtime.
Issue details

debug_assert is being used in multiple pallets. We were able to trigger a panic condition for the following debug_asserts in pallet prediction-markets and parimutuel:

Risk
The nodes compiled in debug mode will panic as intended during debugging and development, although, some nodes might run in debug mode even if they are in production. For the nodes built in release mode, logic inconsistencies may appear.

Mitigation
Using debug_assert is a best practice deviation and it should not be used other than for debugging purpose. We suggest replacing the usage of debug_assert with proper checking and error handling.

@sea212 sea212 added p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement l:S Solving this issue takes hours labels Dec 22, 2023
@Chralt98 Chralt98 self-assigned this Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
l:S Solving this issue takes hours p:low Low priority, resolution of this issue can wait t:enhancement The issue described an enhancement
Projects
None yet
Development

No branches or pull requests

2 participants