Author: Jeremy 2021-07-07 17:26:38
Published on: 2021-07-07T17:26:38+00:00
The post discusses the issue of permitting recursion at the transaction level and the arguments against it from a safety perspective. The author raises concerns about the ability to "go wrong" in surprising ways with recursive covenants and provides an example of a non-recursive covenant that demonstrates the issue. The example program is subtly "wrong" because the state transition of add_member does not verify that the pool's future withdraw call will be valid, and this could lead to a premature termination of the program. The author suggests that as we explore enabling covenants, we should add primitives in a methodical way and give users/toolchain builders primitives that enable and encourage safety and good program design. The CTV/Sapio model with its AOT compilation of automated state transitions and ability to statically analyze is a concept that can mature and be used in production in the near term, but the tooling to safely do recursive computations at the txn level will take quite a bit longer to mature.
Updated on: 2023-06-15T00:03:05.829266+00:00