From 4b3da53f5cb0b364d82cfe33173bf3040ed08bdd Mon Sep 17 00:00:00 2001 From: Diane Gallois-Wong Date: Fri, 11 Apr 2025 17:23:28 +0200 Subject: [PATCH 1/3] proto/operation_repr: in BLS attestation, remove DAL from signed content --- .../lib_protocol/operation_repr.ml | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/proto_alpha/lib_protocol/operation_repr.ml b/src/proto_alpha/lib_protocol/operation_repr.ml index 0fb269978f8c..bff7fd97cd65 100644 --- a/src/proto_alpha/lib_protocol/operation_repr.ml +++ b/src/proto_alpha/lib_protocol/operation_repr.ml @@ -1868,30 +1868,23 @@ module Encoding = struct { tag = 41; name = "bls_mode_attestation"; - encoding = - merge_objs - consensus_aggregate_content_encoding - (obj1 (opt "dal" dal_content_encoding)); + encoding = consensus_aggregate_content_encoding; select = (function Contents (Attestation _ as op) -> Some op | _ -> None); proj = - (fun (Attestation {consensus_content; dal_content}) -> - ( { - level = consensus_content.level; - round = consensus_content.round; - block_payload_hash = consensus_content.block_payload_hash; - }, - Option.map - (fun dal_content -> dal_content.attestation) - dal_content )); + (fun (Attestation {consensus_content; dal_content = _}) -> + { + level = consensus_content.level; + round = consensus_content.round; + block_payload_hash = consensus_content.block_payload_hash; + }); inj = - (fun ({level; round; block_payload_hash}, dal_content) -> + (fun {level; round; block_payload_hash} -> Attestation { consensus_content = {slot = Slot_repr.zero; level; round; block_payload_hash}; - dal_content = - Option.map (fun attestation -> {attestation}) dal_content; + dal_content = None; }); } -- GitLab From 12bbc14e772c137c16693c303aab1662c0d3c63f Mon Sep 17 00:00:00 2001 From: Diane Gallois-Wong Date: Fri, 11 Apr 2025 18:32:39 +0200 Subject: [PATCH 2/3] kaitai: update Generated with: dune exec -- client-libs/bin_codec_kaitai/codec.exe dump kaitai specs in client-libs/kaitai-struct-files/files --- .../files/alpha__operation__bls_mode_unsigned.ksy | 6 ------ 1 file changed, 6 deletions(-) diff --git a/client-libs/kaitai-struct-files/files/alpha__operation__bls_mode_unsigned.ksy b/client-libs/kaitai-struct-files/files/alpha__operation__bls_mode_unsigned.ksy index 4a5550565793..454865ebe155 100644 --- a/client-libs/kaitai-struct-files/files/alpha__operation__bls_mode_unsigned.ksy +++ b/client-libs/kaitai-struct-files/files/alpha__operation__bls_mode_unsigned.ksy @@ -358,12 +358,6 @@ types: type: s4be - id: block_payload_hash size: 32 - - id: dal_tag - type: u1 - enum: bool - - id: dal - type: z - if: (dal_tag == bool::true) bls_mode_preattestation: seq: - id: level -- GitLab From cdde74c7ed2be923904116aea7e6233c4d2afac4 Mon Sep 17 00:00:00 2001 From: Diane Gallois-Wong Date: Fri, 11 Apr 2025 18:42:42 +0200 Subject: [PATCH 3/3] tezt: reset regressions dune exec tezt/tests/main.exe -- -f tezt/tests/encoding.ml -m bls alpha --reset-regressions --- ... encoding regression test- operation.bls_mode_unsigned.out | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tezt/tests/expected/encoding.ml/Alpha- protocol encoding regression test- operation.bls_mode_unsigned.out b/tezt/tests/expected/encoding.ml/Alpha- protocol encoding regression test- operation.bls_mode_unsigned.out index c96d8207fd52..6728d233e47d 100644 --- a/tezt/tests/expected/encoding.ml/Alpha- protocol encoding regression test- operation.bls_mode_unsigned.out +++ b/tezt/tests/expected/encoding.ml/Alpha- protocol encoding regression test- operation.bls_mode_unsigned.out @@ -10,9 +10,9 @@ } ] }' -0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8290000053300000000000000000000000000000000000000000000000000000000000000000000000000 +0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a82900000533000000000000000000000000000000000000000000000000000000000000000000000000 -./octez-codec decode alpha.operation.bls_mode_unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a8290000053300000000000000000000000000000000000000000000000000000000000000000000000000 +./octez-codec decode alpha.operation.bls_mode_unsigned from 0e5751c026e543b2e8ab2eb06099daa1d1e5df47778f7787faab45cdf12fe3a82900000533000000000000000000000000000000000000000000000000000000000000000000000000 { "branch": "BKpbfCvh777DQHnXjU2sqHvVUNZ7dBAdqEfKkdw8EGSkD9LSYXb", "contents": [ { "kind": "bls_mode_attestation", "level": 1331, "round": 0, -- GitLab