Protocol Jakarta

Important: revision PtJakarta...nGw of protocol Jakarta contains two critical bugs that have been corrected in the latest version PtJakart2...SqY.

This page contains all the relevant information for protocol Jakarta (see Protocol naming).

The code can be found in the src/proto_013_PtJakart directory of the master branch of Tezos.

This page documents the changes brought by protocol Jakarta with respect to Ithaca.

New Environment Version (V5)

This protocol requires a different protocol environment than Ithaca. It requires protocol environment V5, compared to V4 for Ithaca. (MR !4071)

  • Remove compatibility layers. (MR !4215)

  • Lwtreslib updates from stdlib 4.13. (MR !4279)

  • Update to data encoding 0.5 and support compact encoding. (MRs !4339, !4582)

  • Add Merkle proofs to the protocol. (MRs !4086, !4307, !4509, !4536, !4694)

  • Update Bls_signature to bls12-381.3.0.1. (MRs !4383, !4732)

  • Add pk/signature_size_in_bytes in Bls_signature. (MR !4492)

  • Add size_in_memory for BLS types and reset test configurations of for the typed IR size to previous values. (MR !4464)

  • Provide let* binding operators. (MR !4365)

  • Expose Blake2b.Make_merkle_tree. (MR !4618)

  • Sync interfaces with upstreams. (MR !4617)

  • Export context configuration. (MR !4601)

  • Remove unused function register_resolver. (MR !4591)

Liquidity Baking

Several changes are made to the Liquidity Baking Escape Vote (MR !4201):

  • The options are renamed On (instead of false) and Off (instead of true) to reduce confusion.

  • A third Pass option is added. When this option is used the exponential moving average (EMA) of escape votes is not affected by the block. Note to developers of baking software: we don’t recommend to use this option as a default value; instead we recommend to force the user to explicitly choose one of the three options; this behavior has been implemented in Octez’ tezos-baker.

  • The escape hatch threshold is reset to 50% to account for the new symmetry in the escape vote introduced by Pass option.

  • The precision of the EMA computation has been increased by a factor of 1000. To achieve this without overflowing, this computation is now performed using arbitrary-precision arithmetic. The EMA itself and the EMA threshold are still stored on 32bits.

  • EMA is always rounded toward the threshold.

  • When the EMA reaches the threshold, the deactivation of the subsidy is not permanent anymore. If the proportion of bakers voting On later increases and the EMA falls back below the threshold then the subsidy is restarted.

  • The Liquidity Baking Escape Vote is renamed into “Liquidity Baking Toggle Vote”.

Smart Contract Optimistic Rollups (ongoing)

Support for execution of smart contracts inside rollups is in progress and is not enabled yet. (MRs !3941, !4000, !4020, !4148, !4173, !4483, !4563, !4629, !4586, !4621, !4700, !4343, !4770, !4791, !4498, !4620, !4568, !4289)

Tickets Hardening

Ticket handling has been improved via runtime token validation layer, which adds extra layer of protection for ticket semantics. (MRs !4011, !3826, !4303, !4168, !4323, !4334, !4426, !4491, !4341, !4190)

Voting procedure

The voting power of a delegate is no longer rounded to rolls, it is now instead the full staking power of the delegate, currently expressed in mutez. (MR !4265)

Breaking Changes

  • The binary encoding of the result of the Transaction operation has changed. Its contents now vary depending on the kind of destination. The default cases (implicit and smart contracts) are prefixed with the tag 0. (MR !4205)

  • The consumed_gas field in the encoding of operations becomes deprecated in favour of consumed_milligas, which contains a more precise readout for the same value. consumed_milligas field was added to the encoding of block metadata for uniformity. (MR !4388)

  • The following RPCs output format changed:

    1. /chains/<chain_id>/blocks/<block>/votes/proposals,

    2. /chains/<chain_id>/blocks/<block>/votes/ballots,

    3. /chains/<chain_id>/blocks/<block>/votes/listings,

    4. /chains/<chain_id>/blocks/<block>/votes/total_voting_power,

    5. /chains/<chain_id>/blocks/<block>/context/delegates/<public_key_hash>

    6. /chains/<chain_id>/blocks/<block>/context/delegates/<public_key_hash>/voting_power

    The voting power that was represented by int32 (denoting rolls) is now represented by an int64 (denoting mutez). Furthermore, in the RPC /chains/<chain_id>/blocks/<block>/votes/listings, the field rolls has been replaced by the field voting_power. (MR !4265)

  • Encoding of transaction and origination operations no longer contains deprecated big_map_diff field. lazy_storage_diff should be used instead. (MR: !4387)

  • The JSON and binary encodings for Liquidity Baking Toggle Votes have changed as follows:

Changes to encodings of Liquidity Baking Toggle Vote

Vote option

Old binary encoding

Old JSON encoding

New binary encoding

New JSON encoding

On

0x00

false

0x00

"on"

Off

any other byte

true

0x01

"off"

Pass

N/A

N/A

0x02

"pass"

  • The values of the Liquidity Baking EMA in block receipts and the Liquidity Baking EMA threshold in the constants have been scaled by 1000, the new value of the threshold is 1,000,000,000. To compute the proportion Off/(On + Off) of toggle votes the following formula can be used: liquidity_baking_toggle_ema / 2,000,000,000.

  • Receipts and balance updates may now refer to a new type of account with the kind "freezer" and the category "bonds". Bonds are like deposits. However, they can be associated to implicit or originated accounts, unlike deposits that only apply to implicit accounts that are also delegates (see Token transfers and balance updates). (MR !4437)

Bug Fixes

  • Expose consumed_milligas in the receipt of the Register_global_constant operation. (MR !3981)

  • Refuse operations with inconsistent counters. (MR !4024)

  • Normalize scripts in optimized format during origination. (MR !3852)

Minor Changes

  • The RPC ../context/delegates can take two additional Boolean flags, with_minimal_stake or without_minimal_stake, to select delegates that have at least a minimal stake to participate in consensus and governance, or do not have such a minimal stake, respectively. (MR !3951)

  • Make cache layout a parametric constant of the protocol. (MR !4035)

  • Change blocks_per_voting period in context with cycles_per_voting_period (MR !4456)

  • Use dedicated error for duplicate ballots. (MR !4209)

  • Allow committee size to be < 4. (MR !4308)

  • Remove delegate_selection parameter and introduce initial_seed parameter. (MR !3842)

  • Retrieve a contract’s public key before prechecking an operation. (MR !4877)

  • Normalize types and code of views in RPCs and client commands. (MR !4911)

Michelson

  • Some operations are now forbidden in views: CREATE_CONTRACT, SET_DELEGATE and TRANSFER_TOKENS cannot be used at the top-level of a view because they are stateful, and SELF because the entry-point does not make sense in a view. However, CREATE_CONTRACT, SET_DELEGATE and TRANSFER_TOKENS remain available in lambdas defined inside a view. (MR !3737)

  • Non-entrypoint annotations are ignored by the typechecker and not propagated.

    • All contracts that used to typecheck correctly before will still typecheck correctly afterwards. Though more contracts are accepted as branches with different annotations won’t be rejected anymore.

    • The special annotation %@ of PAIR has no effect.

    • RPCs /chains/<chain_id>/blocks/<block>/context/contracts/<address>/typecheck_code, /chains/<chain_id>/blocks/<block>/context/contracts/<address>/trace_code, as well as typechecking errors reporting stack types, won’t report annotations anymore.

      In their output encodings, the objects containing the fields item and annot are replaced with the contents of the field item.

    • RPCs /chains/<chain_id>/blocks/<block>/context/contracts/<address>, /chains/<chain_id>/blocks/<block>/context/contracts/<address>/script/normalized, /chains/<chain_id>/blocks/<block>/context/contracts/<address>/entrypoints, /chains/<chain_id>/blocks/<block>/context/contracts/<address>/entrypoints/normalized, /chains/<chain_id>/blocks/<block>/context/contracts/<address>/entrypoints/<entrypoint>, /chains/<chain_id>/blocks/<block>/context/contracts/<address>/entrypoints/<entrypoint>/normalized accept a new boolean parameter normalize_types to show types without their annotations.

    • (MRs !4139, !4140, !4141, !4175, !4311, !4259, !4844, !4876, !4893)

  • Annotating the parameter toplevel constructor to designate the root entrypoint is now forbidden. Put the annotation on the parameter type instead. E.g. replace parameter %a int; by parameter (int %a); (MR !4366)

  • The VOTING_POWER of a contract is no longer rounded to rolls. It is now instead the full staking power of the delegate, currently expressed in mutez. Though, developers should not rely on VOTING_POWER to query the staking power of a contract in mutez: the value returned by VOTING_POWER is still of type` nat and it should only be considered relative to TOTAL_VOTING_POWER. (MR !4265)

  • The new type tx_rollup_l2_address has been introduced. It is used to identify accounts on transaction rollups’ legders. Values of type tx_rollup_l2_address are 20-byte hashes of a BLS public keys (with a string notation based of a base58 encoding, prefixed with tz4). (MR !4431)

  • A new instruction MIN_BLOCK_TIME has been added. It can be used to push the current minimal time between blocks onto the stack. The value is obtained from the protocol’s minimal_block_delay constant. (MR !4471)

  • The existing type sapling_transaction is renamed sapling_transaction_deprecated and is deprecated. Existing onchain contracts are automatically converted. A new Michelson type sapling_transaction and an overload of the instruction SAPLING_VERIFY_UPDATE have been added to fix the malleability problem of the old instruction (see Sapling integration). (MRs !4670, !4589)

  • The protocol migration to Alpha will ensure that 8 smart contracts on mainnet that depend on features deprecated in Babylon, type check under the new protocol without the --legacy flag. This will be ensured by patching the contracts. Their behaviour will remain unchanged which was tested by replaying historic transactions to these smart contracts with the updated code. For more information on which contracts are patched and how the change can be tested read the description of the MR that brought the migration. (MRs !3730, !4681)

RPC Changes

  • Add selected_snapshot RPC that replaces deleted roll_snapshot. (MRs !4479, !4585)

Internal

The following changes are not visible to the users but reflect improvements of the codebase.

  • BALANCE is now passed to the Michelson interpreter as a step constant instead of being read from the context each time this instruction is executed. (MR !3871)

  • Faster gas monad. (MR !4034)

  • Carbonated map utility module. (MRs !3845, !4156)

  • Rewrite step constants explicitly when entering a view. (MR !4230)

  • Update migration for Ithaca. (MR !4107)

  • Tenderbake: Optimizing round_and_offset. (MR !4009)

  • Make protocol easier to translate to Coq. (MR !4260)

  • Generalize the destination argument of Transaction. (MR !4205)

  • Do not propagate operations conditioned by a feature flag. (MR !4330)

  • Optimize local gas counter exhaustion checking. (MR !4305)

  • Fix edge case in pseudorandom computations. (MR !4385)

  • Ensure voting periods end at cycle ends. (MR !4425)

  • Gas: move Size module to lib_protocol. (MR !4337)

  • Cleanup Tenderbake code. (MRs !4423, !4436, !4225,)

  • Fix coq:lint error ignoring message (MR !4473)

  • Take user/automatic protocol upgrades into account during operation simulation. (MR !4433)

  • Improve gas model of unparse_script. (MR !4328)

  • Remove unreachable code (MR !4615)

  • Separate internal operations. (MRs !4613, !4623, !4632, !4643)

  • Stakable frozen bonds. (MR !4437)

  • Rename first_level_of_Tenderbake for consistency. (MR !4825)

  • Update gas cost model. (MR !4840)

  • Update size cost model. (MR !4948)

  • Internal refactorings in Michelson typechecker and interpreter. (MRs !4502, !4693, !4692, !4658, !4507, !4578, !4506, !4133, !4429, !4427, !4298, !4297, !4363, !4364, !3863, !3696)

  • Other internal refactorings or documentation. (MRs !4276, !4457, !3928, !4041, !4088, !3755, !4128, !4262, !4257, !4293, !4444, !4224, !4432, !4468, !4777, !4820, !4287)