Closed amimart closed 1 month ago
The recent changes in the codebase involve the removal of two Prolog predicates, "set_prolog_flag/2"
and "halt/1"
, from the interpreter's registry. This adjustment is part of an effort to enhance security and streamline functionality, addressing concerns about potential misuse that could lead to operational disruptions in the blockchain environment.
Files | Change Summary |
---|---|
x/logic/interpreter/registry.go |
Removed entries for {"set_prolog_flag/2", engine.SetPrologFlag} and {"halt/1", engine.Halt} . |
Objective | Addressed | Explanation |
---|---|---|
Remove halt/1 to prevent potential DOS risks (β
#624) |
β | |
Address security concerns linked to halt/1 and non-deterministic predicates (β
#617, #336) |
β |
π In the garden where logic blooms bright,
Two predicates vanished, making things right.
No more halting, just smooth, steady flow,
Our blockchain hops high, with each leap we grow!
A safer path now, with each line we write,
A dance of the code, under moon's gentle light. π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
@@ Coverage Diff @@
## main #710 +/- ##
=======================================
Coverage 54.42% 54.42%
=======================================
Files 73 73
Lines 2901 2901
=======================================
Hits 1579 1579
Misses 1228 1228
Partials 94 94
Closes https://github.com/axone-protocol/axoned/issues/624 Closes https://github.com/axone-protocol/axoned/issues/617 Closes https://github.com/axone-protocol/axoned/issues/336
Purpose
This PR aims to make the logic module prolog vm finally safe, by removing unsafe predicates from the registry. By doing so they cannot be added even through a governance proposal.
The idea is to expose through the registry only safe to use predicates.
Details
Since the recent changes in the VM I was honestly quite disappointed to discover only 2 unsafe predicates π . AFAIS previously suspected predicates have all been fixed by the improved VM.
Here are the removed predicates:
halt/1
: Make a node to halt, if used in the context of a transaction the network is stopped;set_prolog_flag/2
: This one doesn't seem really unsafe to me regarding the flags we are able to change, but the intent of changing the VM's behaviour (e.g. enable debug mode) is not desirable to me;Let me know if you have any other potentially unsafe predicates in mind.
Summary by CodeRabbit
New Features
Bug Fixes