zeitgeist icon indicating copy to clipboard operation
zeitgeist copied to clipboard

Potential panic from debug_assert

Open sea212 opened this issue 1 year ago • 0 comments

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 avatar Dec 22 '23 11:12 sea212