diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-08 20:06:03 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-08 20:06:03 -0300 |
| commit | 4896005e5d156e8a590b12946a54507daa895686 (patch) | |
| tree | 989e420e0e58169d8f87e593461d471a10001152 /lib/kernel | |
| parent | 41224db2c0929db32da31718af04655ce5e138e6 (diff) | |
| download | RNT-4896005e5d156e8a590b12946a54507daa895686.tar.gz RNT-4896005e5d156e8a590b12946a54507daa895686.zip | |
tests
Diffstat (limited to '')
| -rw-r--r-- | lib/kernel/BranchManager.ml | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/kernel/BranchManager.ml b/lib/kernel/BranchManager.ml index a371a0c..4d2fb1d 100644 --- a/lib/kernel/BranchManager.ml +++ b/lib/kernel/BranchManager.ml @@ -53,9 +53,12 @@ module Make (S : Abstract.Storage.STORAGE) = struct | None -> Ok None | Some head -> B.load ?root tx storage head |> Result.map Option.some ) + (* a head moves only to a valid state, judged before the head is + taken, since judging may run stored programs that read storage *) method update key reference value = let open Utilities.Result in let open Protocols in + let* () = Option.fold ~none:(Ok ()) ~some:Denial.check value in SI.with_transaction storage (fun tx -> match Utilities.Atomic.mswap head (fun head -> |
