Tezlink/Kernel/OperationResult : Fix and test receipt encoding
Related to #8018
Linear issue
Closes L2-156.
What
This MR implements support for decoding and roundtripping Tezos operation metadata in the EVM kernel, and registers the associated encoding in PsRiotum, PtSeouLo, and Alpha protocols.
Why
Support for the operation_data_and_metadata encoding is required for decoding the full operation metadata structure, including receipts, in the l2node. This is necessary for compatibility with tezos protocol. Without it, deserialization of Tezos-compatible operation metadata fails.
How
- Introduces a full implementation of
OperationDataAndMetadatawith encoding and decoding logic. - Refactors
AppliedOperationin the kernel to use the new structure. - Adds
VecEmptyandEmptyplaceholder types for partially supported Tezos fields (e.g.,ticket_receipt,lazy_storage_diff) while ensuring roundtripping works. - Registers the
operation_data_and_metadata_encodingunder the RPC encoding registry in protocolsPsRiotum,PtSeouLo, andAlpha. - Adds tests to validate compatibility with
octez-codecserialized payloads.
Manually testing the MR
To test:
- Rebuild the kernel and protocols.
- Use
octez-codecand check that the new encodings are registered. - Run unit tests in
tezos_tezlink_latestandtezos_executionto ensure roundtrip encoding/decoding and logic correctness.
# Run kernel unit tests
cd etherlink/kernel_latest/
cargo test
Edited by Raphaël Cauderlier