alpha: introduce attestation encoding and version 2 of operation encoding
Context
This MR solves #5357 (closed) (alternative proposition of !8254 (closed)) and partially solves #5358 (closed).
This MR add encodings for attestation, preattestation, double_attestation_evidence and double_preattestation_evidence in JSON operations. Encodings that support old endorsement kinds are tagged as legacy but still set as default until attestation kinds becomes the default one.
This new encoding that supports attestation kinds can be used by octez-codec with the new versioned operation_v2 encoding.
Manually testing the MR
This MR adds tests for new operation_v2 and operation_v2.unsigned encoding. It also adds some cases such as preendorsement for operation encoding. To run these tests:
dune exec tezt/tests/main.exe -- encoding protocol operation_with_attestation -i
This MR could also be manually tested with:
- Change the
operation_data_encodingused inmain.mlby removing_with_legacy_attestation_name - Compile
- Launch a sandboxed node and client
- Activate Alpha
- Start a baker
- Run
octez-client rpc get /chains/main/mempool/pending_operationsyou will observe that endorsements appears withattestationkind in operation contents.
Checklist
- n/a Document the interface of any function added or modified (see the coding guidelines)
- n/a Document any change to the user interface, including configuration parameters (see node configuration)
-
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Albin Coquereau