Protocol Lima

This page documents the changes brought by protocol Lima with respect to Kathmandu (see Protocol naming).

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

New Environment Version (V7)

This protocol requires a different protocol environment version than Kathmandu. It requires protocol environment V7, compared to V6 for Kathmandu. (MR !5906)

  • Simplify the protocol-environment build process by including camlInternalFormatBasic — which is not intended for use by developers. (MR !5910)

  • Abstract public_parameters type in Plonk. (MR !6077)

  • Add option monad syntaxes and Update Lwt. (MR !6040)

  • Introduce an Array module, making a subset of Stdlib.Array available to the protocol (MR !6042)

  • Introduce a module Q, making a subset of Zarith.Q available to the protocol (MR !6092)

  • Generalise the Bounded module to support more datatypes. (MR !6076)

  • Remove PVSS from lib_crypto and protocol environments. (MR !6183)

  • Adapt to Resto 0.10. (MR !6085)

  • Introduce a Bls module to gather both high and low level functions for BLS cryptography. (MR !6295)

  • Introduce a new protocol API adapted to pipelined validation. (MR !6335)

  • Add missing list functions. (MR !6316)

Consensus key

The “consensus key” feature allows bakers to use a different key, called the consensus key for consensus, that is, for baking and for signing consensus operations (i.e. preendorsements and endorsements). It also allows them to update this key. The update becomes active after PRESERVED_CYCLES + 1 cycles. We therefore distinguish the active consensus key and the pending consensus keys. (There can be multiple pending updates.) The active consensus key is by default the baker’s regular key, called its manager key, which cannot change.

Two new operations have been added:

Update_consensus_key (<public_key>)

This is a manager operation that must be signed by the manager key of a baker. This operation updates the consensus key of the baker to public_key starting from the current cycle plus PRESERVED_CYCLES + 1. A consensus key can only be used by a single baker, the operation fails otherwise.

Drain_delegate (<baker_pkh, consensus_pkh, destination_pkh>)

This is an operation that must be signed by the active consensus key consensus_pkh of the baker baker_pkh. This operation immediately transfers all the spendable balance of the baker_pkh’s implicit account into the destination_pkh implicit account. It has no effect on the frozen balance. This operation is included in pass 2 (anonymous operations). So drain operations don’t compete with regular manager operations for gas and block size quota; the 1M restriction (one-operation-per-manager-per-block) applies to drain operations as well, meaning that a drain for a baker and a transfer operation from the same baker are in conflict. As an incentive for bakers to include drain operations, a fixed fraction of the drained baker’s spendable balance is transferred as fees to the baker that includes the operation, i.e. the maximum between 1tz or 1% of the spendable balance.

(Breaking changes) Some existing RPCs have been updated:

  • /chains/main/blocks/head/metadata

    The block metadata is extended with the active consensus key of the baker and the proposer. The fields proposer and baker still hold the respective public key hashes of the manager keys of the proposer and the baker.

"proposer_consensus_key": "[PUBLIC_KEY_HASH]",
"baker_consensus_key": "[PUBLIC_KEY_HASH]",
  • /chains/main/blocks/head/context/delegates/[PUBLIC_KEY_HASH]

    The delegate data is extended with the active and pending consensus keys.

{"full_balance": "4000000000000",
 "current_frozen_deposits": "200000000000",
 "frozen_deposits": "200000000000",
 "staking_balance": "4000000000000",
 "delegated_contracts": [ "[PUBLIC_KEY_HASH]" ],
 "delegated_balance": "0",
 "deactivated": false,
 "grace_period": 5,
 "voting_power": "4000000000000",
 "active_consensus_key": "[PUBLIC_KEY_HASH]",
 "pending_consensus_keys": [
     { "cycle": 7, "pkh": "[PUBLIC_KEY_HASH]},
     { "cycle": 9, "pkh": "[PUBLIC_KEY_HASH]}
   ]}}
  • /chains/main/blocks/head/helpers/baking_rights

    The baking rights RPC now returns both the manager key, required to identify the rewarded delegate, and the active consensus key required to sign a block. The RPC also accepts a new parameter consensus_key=<pkh> to filter the result by the active consensus key.

[{ "level": 2, "delegate": "[PUBLIC_KEY_HASH]",
   "round": 0, "estimated_time": "[TIMESTAMP]",
   "consensus_key": "[PUBLIC_KEY_HASH]" },
 { "level": 2, "delegate": "[PUBLIC_KEY_HASH]",
   "round": 1, "estimated_time": "[TIMESTAMP]",
   "consensus_key": "[PUBLIC_KEY_HASH]" },
 { "level": 2, "delegate": "[PUBLIC_KEY_HASH]",
   "round": 2, "estimated_time": "[TIMESTAMP]",
   "consensus_key": "[PUBLIC_KEY_HASH]" },
 { "level": 2, "delegate": "[PUBLIC_KEY_HASH]",
   "round": 3, "estimated_time": "[TIMESTAMP]",
   "consensus_key": "[PUBLIC_KEY_HASH]" },
 { "level": 2, "delegate": "[PUBLIC_KEY_HASH]",
   "round": 10, "estimated_time": "[TIMESTAMP]",
   "consensus_key": "[PUBLIC_KEY_HASH]" }]
  • /chains/main/blocks/head/helpers/endorsing_rights

    The endorsing rights RPC now returns both the manager key, required to identify the rewarded delegate, and the active consensus key required to sign a block. The RPC also accepts a new parameter consensus_key=<pkh> to filter the result by the active consensus key.

[ { "level": 1,
    "delegates":
     [ { "delegate": "[PUBLIC_KEY_HASH]",
         "first_slot": 11, "endorsing_power": 50,
         "consensus_key": "[PUBLIC_KEY_HASH]" },
       { "delegate": "[PUBLIC_KEY_HASH]",
         "first_slot": 4, "endorsing_power": 47,
         "consensus_key": "[PUBLIC_KEY_HASH]" },
       { "delegate": "[PUBLIC_KEY_HASH]",
         "first_slot": 2, "endorsing_power": 46,
         "consensus_key": "[PUBLIC_KEY_HASH]" },
       { "delegate": "[PUBLIC_KEY_HASH]",
         "first_slot": 1, "endorsing_power": 55,
         "consensus_key": "[PUBLIC_KEY_HASH]" },
       { "delegate": "[PUBLIC_KEY_HASH]",
         "first_slot": 0, "endorsing_power": 58,
         "consensus_key": "[PUBLIC_KEY_HASH]" } ] } ]

MRs: !5936, !5961, !5970

Zero Knowledge Rollups (ongoing)

Rollups supporting cryptographic proofs of correct execution. (MRs !6044, !6184, !6045)

Data Availability Layer (ongoing)

Distribution of rollup operations data off-chain. (MRs !5711, !5938, !6024, !5959, !6062, !6210, !6216, !6033, !6022, !6265, !6266, !6273, !6272, !6328, !6279, !6348, !6256, !6321)

Liquidity Baking

The liquidity_baking_sunset_level parameter has been removed since the subsidy can now be shut off with the toggle introduced in Jakarta. (MR !6215)

Breaking Changes

  • Deprecate timelock functionality, that is the CHEST_OPEN instruction, in Michelson to prevent origination of new contracts using it. A safer version of timelock will come in a future procotol. (MRs !6260, !6327)

  • Rename the parameter tokens_per_roll to minimal_stake. (MR !5897)

  • Disallow creation, transfer and storage of tickets with zero amounts. TICKET instruction now returns option ticket 'a instead of ticket 'a. For contracts already originated, their TICKET instructions are renamed to TICKET_DEPRECATED. Note that it is not possible to originate contracts containing TICKET_DEPRECATED after the migration. (MR !5963)

RPC Changes

  • The run_operation RPC description has been updated to indicate that the RPC does not support consensus operations. It could already give inconsistent results on such operations, which was not documented. It now returns an error when called on a consensus operation. (MR !5707)

  • New RPC /chains/<chain_id>/blocks/<block>/context/constants/parametric returning the value of parametric economic protocol constants. (MR !5867)

Operation receipts

  • Added ticket_updates field that represents the increase/decrease of tickets in the storage. (MR !6267)

Bug Fixes

  • Ghostnet-specific fixes. (MR !6401)

Minor Changes

  • Split internal transactions. (MR !5585)

  • Add a new LAMBDA_REC instruction to create recursive lambda functions. (MRs !5194, !6144)

  • Rename error Previously_revealed_nonce in Already_revealed_nonce (MR !5849)

  • New error Conflicting_activation (MR !5849)

  • New error Already_denounced replace Unrequired_denunciation (MR !5849)

  • New error Conflicting_denunciation (MR !5849)

  • New error Conflicting_nonce_revelation (MR !5849)

  • New errors in voting operations. (MR !6046)

  • Patch smart contracts containing deprecated annotations. (MR !5752)

  • Errors related to consensus operations have been reworked. See Validate_errors.Consensus. (MR !5927)

  • A delegate can no longer propose the same protocol hash multiple times in Proposals operations. An operation that contains a proposal which has already been proposed by the delegate in the same voting period will now fail (and so will an operation that contains multiple occurrences of the same proposal). This prevents the replay of a Proposals operation. (MR !5828)

  • Change the names and types of errors related to voting operations (Proposals and Ballot), and move them to Validate_errors. (MR !5828)

  • Replace acceptable_passes by acceptable_pass that returns an optional integer instead of a list of at most one element. (MR !6092)

  • Removed relative_position_within_block. (MR !6092)

  • New function compare_operations which defines a total ordering relation. (MR !6092)

  • Removed conflict between proposals/ballots operations and testnet dictator proposals. Ballots and proposals become noops when applying the block after a testnet dictator enacted a protocol change. (MR !6313)

  • Add used and paid storage space services/commands. (MR !6178)

  • The encoding of the proof argument of the transaction rollup’s rejection operation is now opaque, to avoid exposing unnecessary details about their implementation. (MR !6318)

  • Update gas for L. (MR !6519)

Internal

  • Update migration for Kathmandu. (MR !5837)

  • Get rid of unparsing_mode. (MR !5738)

  • Rename internal operation definitions. (MR !5737)

  • Remove Coq attributes. (MR !5735)

  • Internal refactorings in Michelson typechecker and interpreter. (MRs !5586, !5587, !5803, !5804, !5809, !5942, !5625)

  • Ensure payer is an implicit account. (MR !5850)

  • Derive LB subsidy amount from other constants. (MR !5875)

  • Provide correct bounds for seed availability. (MR !4554)

  • Refactor the run_operation RPC. This allowed us to remove a function from Validate_operation.TMP_for_plugin and to no longer expose apply_contents_list and apply_manager_operations in apply.mli. (MR !5770)

  • Rename the function Big_map.list_values to list_key_values and make it return a list of key-value pairs. Also change the name of the signature Non_iterable_indexed_carbonated_data_storage_with_values to Indexed_carbonated_data_storage. (MR !3491)

  • Move the checks part of anonymous operation to validate_operation.ml. The effects part remains in apply_operation. (MR !5849)

  • split check_vdf_and_update_seed function from seed_storage.ml between the checks part, check_vdf, and the application part, update_seed. (MR !5849)

  • Move the checks part of consensus operation to validate_operation.ml. The effects part remains in apply_operation. (MR !5927)

  • Implement Validate_operation.validate_operation on voting operations (Proposals and Ballot). The checks are now done there, while Apply.apply_operation only applies the effects. (MR !5828)

  • A Testnet Dictator Proposals operation is now mutually exclusive with any other voting operation inside a same block or mempool. (MR !5828)

  • Remove redundant Delegate_storage.pubkey and use directly Contract_manager_storage.get_manager_key instead. In situations where the later used to fail with Unregistered_delegate, we now get either Missing_manager_contract or Unrevealed_manager_key, which describe the issue more precisely. (MR !5828)

  • Rely on the protocol for 1M and precheck all operations. (MR !6070)

  • Split the validation from the application of blocks. (MR !6152)

  • Expose a new Mempool mode on the protocol side that offers an API allowing a light validation of operations. This as well as maintaining a commutative set of operations that may also be efficiently merged with another. This enables the implementation of a parallelized shell’s mempool. (MR !6274)

  • Add more functions in Bitset. (MRs !6352, !6376)

  • Make Micheline serialization gas accounting consistent by construction. (MR !6403)

Invoices

@g.b.fefe rewarded 15000 ꜩ and @Ochem rewarded 10000 ꜩ for code contributions (Consensus Key feature) included in this protocol. (MR !6350)