1. Research & development
  2. > Blog >
  3. Mainnet release to patch Babylon

Mainnet release to patch Babylon

announcements
20 September 2019
Nomadic Labs
share:

During the testing phase of protocol Babylon 005_PsBABY5H, we discovered a bug affecting bigmaps in Michelson smart contracts. The bug is corrected in a new version of Babylon, 005_PsBabyM1.

How to proceed

The bug is not critical but causes a significant performance degradation for newly created smart contracts and an incorrect behavior for existing ones using big maps. More details on the nature and effects of the bug can be found in the protocol documentation page.

During the upcoming promotion vote period, we propose two options. The first obvious possibility is to vote Nay so that the current Athens protocol will proceed to a new proposal period. Protocol 005_PsBabyM1 will then be proposed and we will continue with a normal voting procedure. As usual the voting procedure will last 3 months if each voting period is successful.

The second option is for users to download a new version of the Tezos node that, in case of a positive promotion vote, will activate the corrected protocol Babylon 005_PsBabyM1, instead of the defective 005_PsBABY5H. Note that in case of a negative vote this new release of the Tezos node will simply continue to run Athens as expected.

The advantage of the second option is to save the time of a full voting procedure to simply fix a bug. However it is up to the community to decide which option to take.

We do our best to prevent bugs from slipping inside our releases but unfortunately, as with any complex software, there is always a small chance of missing something. This episode proves once again the importance of having a thorough voting and testing procedure.

The patched protocol Babylon 005_PsBabyM1

As with any protocol release it is important to inspect the sources behind a hash. In this case the diff with respect to 005_PsBABY5H consists of two lines, one to fix the bigmap bug described above and one to fix an unrelated problem in an RPC call.

The source of the new Babylon can be found in this tar archive and as usual you can recompute the hash using

mkdir proposal && cd proposal
curl https://research-development.nomadic-labs.com/files/babylon_005_PsBabyM1.tar | tar -x
tezos-protocol-compiler -hash-only babylon_005_PsBabyM1/lib_protocol

The result should be PsBabyM1eUXZseaJdmXFApDSBqj8YBfwELoxZHHW77EMcAbbwAS.

diff --git a/src/proto_alpha/lib_protocol/script_ir_translator.ml b/src/proto_alpha/lib_protocol/script_ir_translator.ml
index 5ad517ab4..b73d610ba 100644
--- a/src/proto_alpha/lib_protocol/script_ir_translator.ml
+++ b/src/proto_alpha/lib_protocol/script_ir_translator.ml
@@ -1038,7 +1038,7 @@ let has_big_map
     | Bool_t _ -> false
     | Lambda_t (_, _, _) -> false
     | Set_t (_, _) -> false
-    | Big_map_t (_, _, _) -> false
+    | Big_map_t (_, _, _) -> true
     | Contract_t (_, _) -> false
     | Operation_t _ -> false
     | Chain_id_t _ -> false
diff --git a/src/proto_alpha/lib_protocol/script_interpreter.ml b/src/proto_alpha/lib_protocol/script_interpreter.ml
index 86d5dde53..3e4917b1a 100644
--- a/src/proto_alpha/lib_protocol/script_interpreter.ml
+++ b/src/proto_alpha/lib_protocol/script_interpreter.ml
@@ -978,7 +978,7 @@ and interp
           log := (code.loc, Gas.level ctxt, stack) :: !log ;
           return_unit
     end >>=? fun () ->
-    step ctxt step_constants code stack >>=? fun (Item (ret, Empty), ctxt) ->
+    step ?log ctxt step_constants code stack >>=? fun (Item (ret, Empty), ctxt) ->
     return (ret, ctxt)

 (* ---- contract handling ---------------------------------------------------*)