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 plusPRESERVED_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 bakerbaker_pkh
. This operation immediately transfers all the spendable balance of thebaker_pkh
’s implicit account into thedestination_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
andbaker
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]" } ] } ]
Smart Contract Optimistic Rollups (ongoing)#
Rollups supporting execution of smart contracts. (MRs !5603, !5606, !5447, !5655, !5660, !5680, !5598, !5677, !5646, !5686, !5693, !5623, !5687, !5714, !5689, !5708, !5565, !5561, !5567, !5332, !5628, !5754, !5736, !5784, !5539, !5764, !5690, !5826, !5812, !5814, !5829, !5813, !5846, !5654, !5761, !5688, !5889, !5859, !5882, !5811, !5898, !5925, !5909, !5902, !5888, !5893, !5884, !5955, !5692, !5887, !5900, !6014, !6009, !6015, !6019, !6012, !5851, !5985, !5984, !6037, !5987, !5878, !6050, !6030, !6060, !5891, !6071, !5926, !6104, !6102, !5973, !6132, !6146, !6185, !6197, !6230, !6237, !6236, !6056, !6186, !6249, !6182, !6243, !6234, !6254, !6280, !6250, !6258, !6130, !6305, !6290, !6303, !6315, !6177, !6294, !6263, !6361, !6278, !6358, !6231, !6400)
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
tominimal_stake
. (MR !5897)Disallow creation, transfer and storage of tickets with zero amounts.
TICKET
instruction now returnsoption ticket 'a
instead ofticket 'a
. For contracts already originated, theirTICKET
instructions are renamed toTICKET_DEPRECATED
. Note that it is not possible to originate contracts containingTICKET_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
inAlready_revealed_nonce
(MR !5849)New error
Conflicting_activation
(MR !5849)New error
Already_denounced
replaceUnrequired_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
byacceptable_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)
A new case has been added to the entrypoint encoding, with tag
5
. This corresponds to thedeposit
entrypoint used both by TORUs and ZKRUs. (MR !6045)
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 fromValidate_operation.TMP_for_plugin
and to no longer exposeapply_contents_list
andapply_manager_operations
inapply.mli
. (MR !5770)Rename the function
Big_map.list_values
tolist_key_values
and make it return a list of key-value pairs. Also change the name of the signatureNon_iterable_indexed_carbonated_data_storage_with_values
toIndexed_carbonated_data_storage
. (MR !3491)Move the checks part of anonymous operation to
validate_operation.ml
. The effects part remains inapply_operation
. (MR !5849)split
check_vdf_and_update_seed
function fromseed_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 inapply_operation
. (MR !5927)Implement
Validate_operation.validate_operation
on voting operations (Proposals and Ballot). The checks are now done there, whileApply.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 directlyContract_manager_storage.get_manager_key
instead. In situations where the later used to fail withUnregistered_delegate
, we now get eitherMissing_manager_contract
orUnrevealed_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)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)