diff --git a/teztale/bin_teztale_archiver/Proxford_machine.real.ml b/teztale/bin_teztale_archiver/Proxford_machine.real.ml index f4bd381cc7b9e154903b74b89145ba4f74b8f09c..16d5ba13b37b85dea4698ce14673870971294377 100644 --- a/teztale/bin_teztale_archiver/Proxford_machine.real.ml +++ b/teztale/bin_teztale_archiver/Proxford_machine.real.ml @@ -76,7 +76,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -92,7 +93,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -243,6 +245,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -263,6 +266,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PsBabyM1_machine.real.ml b/teztale/bin_teztale_archiver/PsBabyM1_machine.real.ml index 1bae8307acad82926502422c723d42ea001a02c1..715da138c6b2e30a47a83f5927b0c8e60517506b 100644 --- a/teztale/bin_teztale_archiver/PsBabyM1_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsBabyM1_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PsCARTHA_machine.real.ml b/teztale/bin_teztale_archiver/PsCARTHA_machine.real.ml index 7a6faa08148d7d84778bf050456747f6aedbb381..f5d68efd97f5fbcb6a2e079c7a6afb74166ec5e5 100644 --- a/teztale/bin_teztale_archiver/PsCARTHA_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsCARTHA_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PsDELPH1_machine.real.ml b/teztale/bin_teztale_archiver/PsDELPH1_machine.real.ml index 1a33aa52d137effcf800ca0b5cd61df7f9b5f833..c159b1bc7292ba3882b5c293319eb470d6369a7b 100644 --- a/teztale/bin_teztale_archiver/PsDELPH1_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsDELPH1_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PsFLoren_machine.real.ml b/teztale/bin_teztale_archiver/PsFLoren_machine.real.ml index 9155f9d92168bc1f5015ce17d8b2c517965c5b6d..79a122bb7e69af553ba12f6ef4c0ad7056465a36 100644 --- a/teztale/bin_teztale_archiver/PsFLoren_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsFLoren_machine.real.ml @@ -84,7 +84,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, None ), - slot ) + slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -211,6 +212,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PsParisC_machine.real.ml b/teztale/bin_teztale_archiver/PsParisC_machine.real.ml index f19e7600df8a1d8a66937c6fb7c46cc7a2fc9841..b3f24eed33bd43fa0552f71d613ea02aba46d8f6 100644 --- a/teztale/bin_teztale_archiver/PsParisC_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsParisC_machine.real.ml @@ -81,7 +81,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,7 +98,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -265,6 +267,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -285,6 +288,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PsQuebec_machine.real.ml b/teztale/bin_teztale_archiver/PsQuebec_machine.real.ml index 5538c0f6f0f140dd50c0c903248c42af47aebb39..14fa23a3a837d7d8dc81005922e2baa5c2f1596c 100644 --- a/teztale/bin_teztale_archiver/PsQuebec_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsQuebec_machine.real.ml @@ -81,7 +81,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,7 +98,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -265,6 +267,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -285,6 +288,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PsRiotum_machine.real.ml b/teztale/bin_teztale_archiver/PsRiotum_machine.real.ml index 16272dd52f668bd002ab217ea603ad2f6d3f7b49..e81c0f7efd90b3a680bc31ca2b24d20c83c43c42 100644 --- a/teztale/bin_teztale_archiver/PsRiotum_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsRiotum_machine.real.ml @@ -81,7 +81,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,7 +98,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -265,6 +267,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -285,6 +288,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PsYLVpVv_machine.real.ml b/teztale/bin_teztale_archiver/PsYLVpVv_machine.real.ml index 4d887c96cd69ce1252e32a4faf2a6e2e30ef18ee..e5d3c9d05340d25d7804268ad5e34128d95dfd3f 100644 --- a/teztale/bin_teztale_archiver/PsYLVpVv_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsYLVpVv_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PsddFKi3_machine.real.ml b/teztale/bin_teztale_archiver/PsddFKi3_machine.real.ml index cb087bae500bef69da9b917af6ee216240f41f1e..7ce1a52cf68dda266202b1d05ed788e713585547 100644 --- a/teztale/bin_teztale_archiver/PsddFKi3_machine.real.ml +++ b/teztale/bin_teztale_archiver/PsddFKi3_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/Psithaca_machine.real.ml b/teztale/bin_teztale_archiver/Psithaca_machine.real.ml index 61922d0a42ae9b1876686b50a4c4661c309bb5ea..8ffb583e9620569bec78e54d22fb821b01791ffb 100644 --- a/teztale/bin_teztale_archiver/Psithaca_machine.real.ml +++ b/teztale/bin_teztale_archiver/Psithaca_machine.real.ml @@ -82,7 +82,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -98,7 +99,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -246,6 +248,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = preendorsement_power; + dal_attested_slots = []; } :: acc | Receipt @@ -266,6 +269,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = endorsement_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/Pt24m4xi_machine.real.ml b/teztale/bin_teztale_archiver/Pt24m4xi_machine.real.ml index 98474167ebd4a759a89b840999ab311f4f7e56a5..cd9fb51fb6651e5ffbd896a65e6306ec3c4193ce 100644 --- a/teztale/bin_teztale_archiver/Pt24m4xi_machine.real.ml +++ b/teztale/bin_teztale_archiver/Pt24m4xi_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PtCJ7pwo_machine.real.ml b/teztale/bin_teztale_archiver/PtCJ7pwo_machine.real.ml index 44933f66a11d5b83042964e9236037fda41ee54f..7bd2a0f0335fb44558206423b5d5cd967ac229d9 100644 --- a/teztale/bin_teztale_archiver/PtCJ7pwo_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtCJ7pwo_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PtEdo2Zk_machine.real.ml b/teztale/bin_teztale_archiver/PtEdo2Zk_machine.real.ml index d897c2ed52379540f638d0950a2ce9544576e760..192739c90b557b325085794425bcb16eae4c3865 100644 --- a/teztale/bin_teztale_archiver/PtEdo2Zk_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtEdo2Zk_machine.real.ml @@ -196,6 +196,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PtGRANAD_machine.real.ml b/teztale/bin_teztale_archiver/PtGRANAD_machine.real.ml index 708099c5f9e6383c5af633711137ce5e7a1a7d0a..2a1a61f8f0cf507ee9a3ac963a7c4cb769e0eea8 100644 --- a/teztale/bin_teztale_archiver/PtGRANAD_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtGRANAD_machine.real.ml @@ -84,7 +84,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, None ), - slot ) + slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -211,6 +212,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PtHangz2_machine.real.ml b/teztale/bin_teztale_archiver/PtHangz2_machine.real.ml index 5f40c4ca95761ca8d81361d5efa2804f9ec488fc..9564cc55b964a830a609e0c9e8281cb06990ff67 100644 --- a/teztale/bin_teztale_archiver/PtHangz2_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtHangz2_machine.real.ml @@ -84,7 +84,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, None ), - slot ) + slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -211,6 +212,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct op = {hash; round = None; kind = Consensus_ops.Attestation}; delegate = public_key_hash_of_v0 delegate; power = List.length slots; + dal_attested_slots = []; } | _ -> None) ops diff --git a/teztale/bin_teztale_archiver/PtJakart_machine.real.ml b/teztale/bin_teztale_archiver/PtJakart_machine.real.ml index 8f9165ee1f69b87204848b4a4caa48793fa21b4a..72bbe7edbe9de4ba91ecdf1fa8d699a452112f00 100644 --- a/teztale/bin_teztale_archiver/PtJakart_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtJakart_machine.real.ml @@ -82,7 +82,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -98,7 +99,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -246,6 +248,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = preendorsement_power; + dal_attested_slots = []; } :: acc | Receipt @@ -266,6 +269,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = endorsement_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PtKathma_machine.real.ml b/teztale/bin_teztale_archiver/PtKathma_machine.real.ml index 935c66a8c3567d2199eb6fa30b41082aed3d8019..b772eeee1e9832872d90009b7f6533be7c44aa60 100644 --- a/teztale/bin_teztale_archiver/PtKathma_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtKathma_machine.real.ml @@ -82,7 +82,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -98,7 +99,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -246,6 +248,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = preendorsement_power; + dal_attested_slots = []; } :: acc | Receipt @@ -266,6 +269,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = endorsement_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PtLimaPt_machine.real.ml b/teztale/bin_teztale_archiver/PtLimaPt_machine.real.ml index 61af5e1fdf98a63fc93b5b8522da848d7a7023df..e32a3092d4696d316711857f8b018ee2c4a4e75f 100644 --- a/teztale/bin_teztale_archiver/PtLimaPt_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtLimaPt_machine.real.ml @@ -82,7 +82,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -98,7 +99,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -247,6 +249,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = preendorsement_power; + dal_attested_slots = []; } :: acc | Receipt @@ -267,6 +270,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = public_key_hash_of_v0 delegate; power = endorsement_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PtMumbai_machine.real.ml b/teztale/bin_teztale_archiver/PtMumbai_machine.real.ml index d1bd33c43392787da722aab5d9e64aade112aac1..83c52bd37c1634849171f38de21b24bd77755c88 100644 --- a/teztale/bin_teztale_archiver/PtMumbai_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtMumbai_machine.real.ml @@ -76,7 +76,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -92,7 +93,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -243,6 +245,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = preendorsement_power; + dal_attested_slots = []; } :: acc | Receipt @@ -263,6 +266,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = endorsement_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PtNairob_machine.real.ml b/teztale/bin_teztale_archiver/PtNairob_machine.real.ml index 217ba7938735f11b7315bcc4a518fd6666c258b6..90c643576528e89cc9e35c3d9af7ffa8111879e8 100644 --- a/teztale/bin_teztale_archiver/PtNairob_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtNairob_machine.real.ml @@ -76,7 +76,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -92,7 +93,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -243,6 +245,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = preendorsement_power; + dal_attested_slots = []; } :: acc | Receipt @@ -263,6 +266,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = endorsement_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PtParisB_machine.real.ml b/teztale/bin_teztale_archiver/PtParisB_machine.real.ml index 23447e7c9ae55a37f30a44b716dbe800375f84f0..ebafa0335c1fe86525e5665b2c572aafb2121419 100644 --- a/teztale/bin_teztale_archiver/PtParisB_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtParisB_machine.real.ml @@ -81,7 +81,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,7 +98,8 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None let consensus_operation_stream cctxt = @@ -265,6 +267,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -285,6 +288,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V1.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | _ -> acc) diff --git a/teztale/bin_teztale_archiver/PtSeouLo_machine.real.ml b/teztale/bin_teztale_archiver/PtSeouLo_machine.real.ml index 180d52a80a0e6cbea77adf69eef013907f79dd33..610bc7bd3319ba0ca6c9d61c29302e32e4859abd 100644 --- a/teztale/bin_teztale_archiver/PtSeouLo_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtSeouLo_machine.real.ml @@ -54,11 +54,36 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct answer.Plugin.RPC.Attestation_rights.delegates_rights) | [] -> return_nil + let dal_attested_slots_of_dal_content ~number_of_slots dal_content = + match dal_content with + | None -> [] + | Some Protocol.Alpha_context.{attestation} -> + let acc = + List.fold_left + (fun acc i -> + match + Protocol.Alpha_context.Dal.Slot_index.of_int_opt + ~number_of_slots + i + with + | None -> acc + | Some slot_index -> + if + Protocol.Alpha_context.Dal.Attestation.is_attested + attestation + slot_index + then i :: acc + else acc) + [] + (Stdlib.List.init number_of_slots Fun.id) + in + List.rev acc + type block_id = Protocol.Block_payload_hash.t module BlockIdMap = Map.Make (Protocol.Block_payload_hash) - let extract_attestation + let extract_attestation ~number_of_slots (operation_content : Protocol.Alpha_context.packed_operation) = match operation_content with | { @@ -70,18 +95,22 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct (Attestation { consensus_content = {slot; level; round; block_payload_hash}; - _; + dal_content; }); signature = _; }; shell = _; } -> + let attested_slots = + dal_attested_slots_of_dal_content ~number_of_slots dal_content + in Some ( ( block_payload_hash, Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + attested_slots ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,10 +126,28 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None + let dal_number_of_slots = + let ans = ref None in + fun cctxt ref_block -> + match !ans with + | Some x -> return x + | None -> + let* constants = + Plugin.Alpha_services.Constants.parametric cctxt ref_block + in + let dal_constants = + constants.Protocol.Alpha_context.Constants.Parametric.dal + in + let out = dal_constants.number_of_slots in + ans := Some out ; + return out + let consensus_operation_stream cctxt = + let* number_of_slots = dal_number_of_slots cctxt (cctxt#chain, `Head 0) in let* ops_stream, stopper = Block_services.Mempool.monitor_operations cctxt @@ -117,7 +164,9 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct return ( Lwt_stream.filter_map (fun ((hash, op), errors) -> - Option.map (fun x -> ((hash, x), errors)) (extract_attestation op)) + Option.map + (fun x -> ((hash, x), errors)) + (extract_attestation ~number_of_slots op)) op_stream, stopper ) @@ -257,6 +306,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct }; delegate = Tezos_crypto.Signature.Of_V2.public_key_hash ck.delegate; power; + dal_attested_slots = []; } :: acc) acc @@ -270,8 +320,22 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct ~block:(`Hash (hash, 0)) 0 in + let* number_of_slots = + dal_number_of_slots cctxt (cctxt#chain, `Hash (hash, 0)) + in + let dal_attested_slots_of_protocol_data protocol_data = + match protocol_data with + | Protocol.Alpha_context.Operation_data {contents; _} -> ( + match contents with + | Single (Attestation {dal_content; _}) -> + dal_attested_slots_of_dal_content ~number_of_slots dal_content + | _ -> []) + in List.fold_left_es (fun acc Block_services.{hash; receipt; protocol_data; _} -> + let dal_attested_slots = + dal_attested_slots_of_protocol_data protocol_data + in match receipt with | Receipt (Protocol.Apply_results.Operation_metadata @@ -293,6 +357,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct delegate = Tezos_crypto.Signature.Of_V2.public_key_hash delegate; power = consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -315,6 +380,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct delegate = Tezos_crypto.Signature.Of_V2.public_key_hash delegate; power = consensus_power; + dal_attested_slots; } :: acc | Receipt @@ -329,13 +395,54 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct balance_updates = _; }); }) -> + let committee_with_dal_content = + match protocol_data with + | Protocol.Alpha_context.Operation_data {contents; _} -> ( + match contents with + | Single + (Attestations_aggregate {committee = dal_committee; _}) -> + List.fold_left + (fun (acc, dal_list) (ck, power) -> + let dal_slots, remianing = + match dal_list with + | (_slot, dal_content_opt) :: rest -> + let dal_attested_slots = + dal_attested_slots_of_dal_content + ~number_of_slots + dal_content_opt + in + (dal_attested_slots, rest) + | [] -> ([], []) + in + (((ck, power), dal_slots) :: acc, remianing)) + ([], dal_committee) + committee + |> fst |> List.rev + | _ -> List.map (fun x -> (x, [])) committee) + in return - @@ consensus_ops_from_aggregate + @@ List.fold_left + (fun acc + ( ((ck : Protocol.Alpha_context.Consensus_key.t), power), + dal_attested_slots ) + -> + Consensus_ops. + { + op = + { + hash; + round = Some (get_attestation_round protocol_data); + kind = Consensus_ops.Attestation; + }; + delegate = + Tezos_crypto.Signature.Of_V2.public_key_hash + ck.delegate; + power; + dal_attested_slots; + } + :: acc) acc - hash - protocol_data - committee - Consensus_ops.Attestation + committee_with_dal_content | Receipt (Protocol.Apply_results.Operation_metadata { diff --git a/teztale/bin_teztale_archiver/PtTALLiN_machine.real.ml b/teztale/bin_teztale_archiver/PtTALLiN_machine.real.ml index ed842de7ba4d38e98d37902c1166fd37e0ce06fe..bf80c20ef8dc1234d196b364bb042230d3421843 100644 --- a/teztale/bin_teztale_archiver/PtTALLiN_machine.real.ml +++ b/teztale/bin_teztale_archiver/PtTALLiN_machine.real.ml @@ -54,11 +54,36 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct answer.Plugin.RPC.Attestation_rights.delegates_rights) | [] -> return_nil + let dal_attested_slots_of_dal_content ~number_of_slots dal_content = + match dal_content with + | None -> [] + | Some Protocol.Alpha_context.{attestation} -> + let acc = + List.fold_left + (fun acc i -> + match + Protocol.Alpha_context.Dal.Slot_index.of_int_opt + ~number_of_slots + i + with + | None -> acc + | Some slot_index -> + if + Protocol.Alpha_context.Dal.Attestation.is_attested + attestation + slot_index + then i :: acc + else acc) + [] + (Stdlib.List.init number_of_slots Fun.id) + in + List.rev acc + type block_id = Protocol.Block_payload_hash.t module BlockIdMap = Map.Make (Protocol.Block_payload_hash) - let extract_attestation + let extract_attestation ~number_of_slots (operation_content : Protocol.Alpha_context.packed_operation) = match operation_content with | { @@ -70,18 +95,22 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct (Attestation { consensus_content = {slot; level; round; block_payload_hash}; - _; + dal_content; }); signature = _; }; shell = _; } -> + let attested_slots = + dal_attested_slots_of_dal_content ~number_of_slots dal_content + in Some ( ( block_payload_hash, Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + attested_slots ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,10 +126,28 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None + let dal_number_of_slots = + let ans = ref None in + fun cctxt ref_block -> + match !ans with + | Some x -> return x + | None -> + let* constants = + Plugin.Alpha_services.Constants.parametric cctxt ref_block + in + let dal_constants = + constants.Protocol.Alpha_context.Constants.Parametric.dal + in + let out = dal_constants.number_of_slots in + ans := Some out ; + return out + let consensus_operation_stream cctxt = + let* number_of_slots = dal_number_of_slots cctxt (cctxt#chain, `Head 0) in let* ops_stream, stopper = Block_services.Mempool.monitor_operations cctxt @@ -117,7 +164,9 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct return ( Lwt_stream.filter_map (fun ((hash, op), errors) -> - Option.map (fun x -> ((hash, x), errors)) (extract_attestation op)) + Option.map + (fun x -> ((hash, x), errors)) + (extract_attestation ~number_of_slots op)) op_stream, stopper ) @@ -258,6 +307,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct delegate = Tezos_crypto.Signature.Of_V2.public_key_hash ck.delegate; power = Protocol.Alpha_context.Attesting_power.get_slots_from_result power; + dal_attested_slots = []; } :: acc) acc @@ -271,8 +321,22 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct ~block:(`Hash (hash, 0)) 0 in + let* number_of_slots = + dal_number_of_slots cctxt (cctxt#chain, `Hash (hash, 0)) + in + let dal_attested_slots_of_protocol_data protocol_data = + match protocol_data with + | Protocol.Alpha_context.Operation_data {contents; _} -> ( + match contents with + | Single (Attestation {dal_content; _}) -> + dal_attested_slots_of_dal_content ~number_of_slots dal_content + | _ -> []) + in List.fold_left_es (fun acc Block_services.{hash; receipt; protocol_data; _} -> + let dal_attested_slots = + dal_attested_slots_of_protocol_data protocol_data + in match receipt with | Receipt (Protocol.Apply_results.Operation_metadata @@ -297,6 +361,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Attesting_power .get_slots_from_result consensus_power; + dal_attested_slots; } :: acc | Receipt @@ -322,6 +387,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Attesting_power .get_slots_from_result consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -336,13 +402,57 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct balance_updates = _; }); }) -> + let committee_with_dal_content = + match protocol_data with + | Protocol.Alpha_context.Operation_data {contents; _} -> ( + match contents with + | Single + (Attestations_aggregate {committee = dal_committee; _}) -> + List.fold_left + (fun (acc, dal_list) (ck, power) -> + let dal_slots, remianing = + match dal_list with + | (_slot, dal_content_opt) :: rest -> + let dal_attested_slots = + dal_attested_slots_of_dal_content + ~number_of_slots + dal_content_opt + in + (dal_attested_slots, rest) + | [] -> ([], []) + in + (((ck, power), dal_slots) :: acc, remianing)) + ([], dal_committee) + committee + |> fst |> List.rev + | _ -> List.map (fun x -> (x, [])) committee) + in return - @@ consensus_ops_from_aggregate + @@ List.fold_left + (fun acc + ( ((ck : Protocol.Alpha_context.Consensus_key.t), power), + dal_attested_slots ) + -> + Consensus_ops. + { + op = + { + hash; + round = Some (get_attestation_round protocol_data); + kind = Consensus_ops.Attestation; + }; + delegate = + Tezos_crypto.Signature.Of_V2.public_key_hash + ck.delegate; + power = + Protocol.Alpha_context.Attesting_power + .get_slots_from_result + power; + dal_attested_slots; + } + :: acc) acc - hash - protocol_data - committee - Consensus_ops.Attestation + committee_with_dal_content | Receipt (Protocol.Apply_results.Operation_metadata { diff --git a/teztale/bin_teztale_archiver/alpha_machine.real.ml b/teztale/bin_teztale_archiver/alpha_machine.real.ml index cd31a5f9c488e8631c3c3a5965913bb5a1b3b2e9..52a9fd14c3cb422f647c1248b0d90ed349dfc091 100644 --- a/teztale/bin_teztale_archiver/alpha_machine.real.ml +++ b/teztale/bin_teztale_archiver/alpha_machine.real.ml @@ -54,11 +54,36 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct answer.Plugin.RPC.Attestation_rights.delegates_rights) | [] -> return_nil + let dal_attested_slots_of_dal_content ~number_of_slots dal_content = + match dal_content with + | None -> [] + | Some Protocol.Alpha_context.{attestation} -> + let acc = + List.fold_left + (fun acc i -> + match + Protocol.Alpha_context.Dal.Slot_index.of_int_opt + ~number_of_slots + i + with + | None -> acc + | Some slot_index -> + if + Protocol.Alpha_context.Dal.Attestation.is_attested + attestation + slot_index + then i :: acc + else acc) + [] + (Stdlib.List.init number_of_slots Fun.id) + in + List.rev acc + type block_id = Protocol.Block_payload_hash.t module BlockIdMap = Map.Make (Protocol.Block_payload_hash) - let extract_attestation + let extract_attestation ~number_of_slots (operation_content : Protocol.Alpha_context.packed_operation) = match operation_content with | { @@ -70,18 +95,22 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct (Attestation { consensus_content = {slot; level; round; block_payload_hash}; - _; + dal_content; }); signature = _; }; shell = _; } -> + let attested_slots = + dal_attested_slots_of_dal_content ~number_of_slots dal_content + in Some ( ( block_payload_hash, Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Attestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + attested_slots ) | { Protocol.Main.protocol_data = Protocol.Alpha_context.Operation_data @@ -97,10 +126,28 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Raw_level.to_int32 level, Consensus_ops.Preattestation, Some (Protocol.Alpha_context.Round.to_int32 round) ), - slot_to_int slot ) + slot_to_int slot, + [] ) | _ -> None + let dal_number_of_slots = + let ans = ref None in + fun cctxt ref_block -> + match !ans with + | Some x -> return x + | None -> + let* constants = + Plugin.Alpha_services.Constants.parametric cctxt ref_block + in + let dal_constants = + constants.Protocol.Alpha_context.Constants.Parametric.dal + in + let out = dal_constants.number_of_slots in + ans := Some out ; + return out + let consensus_operation_stream cctxt = + let* number_of_slots = dal_number_of_slots cctxt (cctxt#chain, `Head 0) in let* ops_stream, stopper = Block_services.Mempool.monitor_operations cctxt @@ -117,7 +164,9 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct return ( Lwt_stream.filter_map (fun ((hash, op), errors) -> - Option.map (fun x -> ((hash, x), errors)) (extract_attestation op)) + Option.map + (fun x -> ((hash, x), errors)) + (extract_attestation ~number_of_slots op)) op_stream, stopper ) @@ -258,6 +307,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct delegate = Tezos_crypto.Signature.Of_V2.public_key_hash ck.delegate; power = Protocol.Alpha_context.Attesting_power.get_slots_from_result power; + dal_attested_slots = []; } :: acc) acc @@ -271,8 +321,22 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct ~block:(`Hash (hash, 0)) 0 in + let* number_of_slots = + dal_number_of_slots cctxt (cctxt#chain, `Hash (hash, 0)) + in + let dal_attested_slots_of_protocol_data protocol_data = + match protocol_data with + | Protocol.Alpha_context.Operation_data {contents; _} -> ( + match contents with + | Single (Attestation {dal_content; _}) -> + dal_attested_slots_of_dal_content ~number_of_slots dal_content + | _ -> []) + in List.fold_left_es (fun acc Block_services.{hash; receipt; protocol_data; _} -> + let dal_attested_slots = + dal_attested_slots_of_protocol_data protocol_data + in match receipt with | Receipt (Protocol.Apply_results.Operation_metadata @@ -297,6 +361,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Attesting_power .get_slots_from_result consensus_power; + dal_attested_slots; } :: acc | Receipt @@ -322,6 +387,7 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct Protocol.Alpha_context.Attesting_power .get_slots_from_result consensus_power; + dal_attested_slots = []; } :: acc | Receipt @@ -336,13 +402,57 @@ module Services : Protocol_machinery.PROTOCOL_SERVICES = struct balance_updates = _; }); }) -> + let committee_with_dal_content = + match protocol_data with + | Protocol.Alpha_context.Operation_data {contents; _} -> ( + match contents with + | Single + (Attestations_aggregate {committee = dal_committee; _}) -> + List.fold_left + (fun (acc, dal_list) (ck, power) -> + let dal_slots, remianing = + match dal_list with + | (_slot, dal_content_opt) :: rest -> + let dal_attested_slots = + dal_attested_slots_of_dal_content + ~number_of_slots + dal_content_opt + in + (dal_attested_slots, rest) + | [] -> ([], []) + in + (((ck, power), dal_slots) :: acc, remianing)) + ([], dal_committee) + committee + |> fst |> List.rev + | _ -> List.map (fun x -> (x, [])) committee) + in return - @@ consensus_ops_from_aggregate + @@ List.fold_left + (fun acc + ( ((ck : Protocol.Alpha_context.Consensus_key.t), power), + dal_attested_slots ) + -> + Consensus_ops. + { + op = + { + hash; + round = Some (get_attestation_round protocol_data); + kind = Consensus_ops.Attestation; + }; + delegate = + Tezos_crypto.Signature.Of_V2.public_key_hash + ck.delegate; + power = + Protocol.Alpha_context.Attesting_power + .get_slots_from_result + power; + dal_attested_slots; + } + :: acc) acc - hash - protocol_data - committee - Consensus_ops.Attestation + committee_with_dal_content | Receipt (Protocol.Apply_results.Operation_metadata { diff --git a/teztale/bin_teztale_archiver/archiver.ml b/teztale/bin_teztale_archiver/archiver.ml index df097473dd1a9efd088b271fea6e136d61bcb53e..620d77a45047aadf3c0e899ee376fdd2acc49e31 100644 --- a/teztale/bin_teztale_archiver/archiver.ml +++ b/teztale/bin_teztale_archiver/archiver.ml @@ -37,4 +37,7 @@ module type S = sig val add_rights : level:Int32.t -> Consensus_ops.rights -> unit val add_dal_shards : level:Int32.t -> Data.Dal.shard_assignment list -> unit + + val add_dal_attested_slots : + level:int32 -> Data.Dal.attested_slots list -> unit end diff --git a/teztale/bin_teztale_archiver/archiver.mli b/teztale/bin_teztale_archiver/archiver.mli index df097473dd1a9efd088b271fea6e136d61bcb53e..620d77a45047aadf3c0e899ee376fdd2acc49e31 100644 --- a/teztale/bin_teztale_archiver/archiver.mli +++ b/teztale/bin_teztale_archiver/archiver.mli @@ -37,4 +37,7 @@ module type S = sig val add_rights : level:Int32.t -> Consensus_ops.rights -> unit val add_dal_shards : level:Int32.t -> Data.Dal.shard_assignment list -> unit + + val add_dal_attested_slots : + level:int32 -> Data.Dal.attested_slots list -> unit end diff --git a/teztale/bin_teztale_archiver/converter.ml b/teztale/bin_teztale_archiver/converter.ml index 4ffc63cb64f0c598e3e96cdcfe7c67faa9c6d64b..e384428bc9736c6903bcd329a98140ed34e30de5 100644 --- a/teztale/bin_teztale_archiver/converter.ml +++ b/teztale/bin_teztale_archiver/converter.ml @@ -127,6 +127,7 @@ let included_ops_map level data = op = {kind; round; hash = maybe_faked_hash}; delegate; power = attesting_power; + dal_attested_slots = []; } acc) acc diff --git a/teztale/bin_teztale_archiver/general_archiver.ml b/teztale/bin_teztale_archiver/general_archiver.ml index ef09c18d6ffaa095ddb05980ce18135c0df5c2c5..c684177ecb5134b476741fb7b937d82348613e57 100644 --- a/teztale/bin_teztale_archiver/general_archiver.ml +++ b/teztale/bin_teztale_archiver/general_archiver.ml @@ -43,6 +43,8 @@ let registered_rights_levels = Ring.create 120 let registered_dal_shards_levels = Ring.create 120 +let registerd_dal_slots_levels = Ring.create 120 + let rights_machine = Protocol_hash.Table.create 10 let past_block_machine = Protocol_hash.Table.create 10 @@ -65,6 +67,12 @@ let maybe_add_dal_shards (module A : Archiver.S) level shard_assignments = Ring.add registered_dal_shards_levels level ; A.add_dal_shards ~level shard_assignments) +let maybe_add_dal_attested_slots (module A : Archiver.S) level attested_slots = + if Ring.mem registerd_dal_slots_levels level then () + else ( + Ring.add registerd_dal_slots_levels level ; + A.add_dal_attested_slots ~level attested_slots) + let dump_my_current_attestations (module A : Archiver.S) ~unaccurate ~level rights attestations = let () = maybe_add_rights (module A) level rights in @@ -188,7 +196,10 @@ module Define (Services : Protocol_machinery.PROTOCOL_SERVICES) = struct let* op_stream, _stopper = Services.consensus_operation_stream cctx' in let*! out = Lwt_stream.fold - (fun ((hash, ((block, level, kind, round), slot)), errors) acc -> + (fun ( (hash, ((block, level, kind, round), slot, _dal_attested_slots)), + errors ) + acc + -> let reception_time = Time.System.now () in let op = Consensus_ops.{op = {hash; kind; round}; errors; reception_time} @@ -345,6 +356,14 @@ module Loops (Archiver : Archiver.S) = struct in Lwt.return_unit + let dal_attested_slots_of_ops = + List.filter_map + (fun Consensus_ops.{op = {hash; _}; dal_attested_slots; _} -> + match dal_attested_slots with + | [] -> None + | slots -> + Some Data.Dal.{operation_hash = hash; attested_slot_indices = slots}) + let maybe_register_rights_and_dal_shards ~rights_of ~dal_shards_of cctx ~level ops = if List.is_empty ops then return_unit @@ -354,6 +373,10 @@ module Loops (Archiver : Archiver.S) = struct let () = maybe_add_rights (module Archiver) pred_level rights in let* dal_shards = dal_shards_of cctx pred_level in let () = maybe_add_dal_shards (module Archiver) pred_level dal_shards in + let attested_slots = dal_attested_slots_of_ops ops in + let () = + maybe_add_dal_attested_slots (module Archiver) level attested_slots + in return_unit let reception_blocks_loop cctx = @@ -437,6 +460,14 @@ module Loops (Archiver : Archiver.S) = struct ~level preattestations in + let dal_attested_slots = + dal_attested_slots_of_ops attestations + in + let () = + Archiver.add_dal_attested_slots + ~level + dal_attested_slots + in let () = Archiver.add_block ~level block_data in return_unit in diff --git a/teztale/bin_teztale_archiver/json_archiver.ml b/teztale/bin_teztale_archiver/json_archiver.ml index b249522ec78240d4f3576a98d9cbe45f31d55d88..9bdf2d67784e5fb5831eded570f3aebccf3571d4 100644 --- a/teztale/bin_teztale_archiver/json_archiver.ml +++ b/teztale/bin_teztale_archiver/json_archiver.ml @@ -545,3 +545,6 @@ let add_rights ~level:_ _rights = () (* not used *) let add_dal_shards ~level:_ _shard_assignments = () + +(* not used *) +let add_dal_attested_slots ~level:_ _attested_slots = () diff --git a/teztale/bin_teztale_archiver/protocol_machinery.ml b/teztale/bin_teztale_archiver/protocol_machinery.ml index 6743947fdded9021167b2ded6f206042a1e91aba..88af09e2d29378dddc50eb5cc3e1715b40af720b 100644 --- a/teztale/bin_teztale_archiver/protocol_machinery.ml +++ b/teztale/bin_teztale_archiver/protocol_machinery.ml @@ -26,7 +26,8 @@ module type PROTOCOL_SERVICES = sig wrap_full -> (((Operation_hash.t * ((block_id * Int32.t * Consensus_ops.operation_kind * Int32.t option) - * int)) + * int + * int list)) * error trace option) Lwt_stream.t * Tezos_rpc.Context.stopper) diff --git a/teztale/bin_teztale_archiver/protocol_machinery.mli b/teztale/bin_teztale_archiver/protocol_machinery.mli index 6743947fdded9021167b2ded6f206042a1e91aba..88af09e2d29378dddc50eb5cc3e1715b40af720b 100644 --- a/teztale/bin_teztale_archiver/protocol_machinery.mli +++ b/teztale/bin_teztale_archiver/protocol_machinery.mli @@ -26,7 +26,8 @@ module type PROTOCOL_SERVICES = sig wrap_full -> (((Operation_hash.t * ((block_id * Int32.t * Consensus_ops.operation_kind * Int32.t option) - * int)) + * int + * int list)) * error trace option) Lwt_stream.t * Tezos_rpc.Context.stopper) diff --git a/teztale/bin_teztale_archiver/server_archiver.ml b/teztale/bin_teztale_archiver/server_archiver.ml index 9a950cd2af4381634b723a832798969b9ff61e9f..fb3b86b2f92c20e1f85be23bcce98c4e91db7ab8 100644 --- a/teztale/bin_teztale_archiver/server_archiver.ml +++ b/teztale/bin_teztale_archiver/server_archiver.ml @@ -20,6 +20,7 @@ type chunk = | Mempool of Int32.t (* level *) * Consensus_ops.delegate_ops | Rights of (Int32.t (* level *) * Consensus_ops.rights) | Dal_shards of Int32.t (* level *) * Data.Dal.shard_assignment list + | Dal_attested_slots of Int32.t (* level *) * Data.Dal.attested_slots list type ctx = { cohttp_ctx : Cohttp_lwt_unix.Net.ctx; @@ -111,6 +112,17 @@ let send_dal_shards ctx level shard_assignments = let path = Int32.to_string level ^ "/dal_shards" in send_something ctx path body +let send_dal_attested_slots ctx level attested_slots = + let body = + `String + (Ezjsonm.value_to_string + (Data_encoding.Json.construct + Data.Dal.attested_slots_list_encoding + attested_slots)) + in + let path = Int32.to_string level ^ "/dal_attested_slots" in + send_something ctx path body + let chunk_stream, chunk_feeder = Lwt_stream.create () let send actx = function @@ -119,6 +131,8 @@ let send actx = function | Rights (level, rights) -> send_rights actx level rights | Dal_shards (level, shard_assignments) -> send_dal_shards actx level shard_assignments + | Dal_attested_slots (level, attested_slots) -> + send_dal_attested_slots actx level attested_slots let launch actx _source = Lwt_stream.iter_p @@ -137,3 +151,6 @@ let add_rights ~level rights = chunk_feeder (Some (Rights (level, rights))) let add_dal_shards ~level shard_assignments = chunk_feeder (Some (Dal_shards (level, shard_assignments))) + +let add_dal_attested_slots ~level attested_slots = + chunk_feeder (Some (Dal_attested_slots (level, attested_slots))) diff --git a/teztale/bin_teztale_archiver/server_archiver.mli b/teztale/bin_teztale_archiver/server_archiver.mli index 24c61502ab1d1764de9a3ba031ec6e216207ed8a..fde34996b0e5eb90c7bdcdae73e0168dd8e080a0 100644 --- a/teztale/bin_teztale_archiver/server_archiver.mli +++ b/teztale/bin_teztale_archiver/server_archiver.mli @@ -20,6 +20,7 @@ type chunk = | Mempool of Int32.t (* level *) * Consensus_ops.delegate_ops | Rights of (Int32.t (* level *) * Consensus_ops.rights) | Dal_shards of Int32.t (* level *) * Data.Dal.shard_assignment list + | Dal_attested_slots of Int32.t (* level *) * Data.Dal.attested_slots list type ctx = { cohttp_ctx : Cohttp_lwt_unix.Net.ctx; diff --git a/teztale/bin_teztale_archiver/teztale_archiver_main.ml b/teztale/bin_teztale_archiver/teztale_archiver_main.ml index 267b72b934d204b6f9f0959643559a4da5b4729f..76620499c495c8514830ceb7a168727c14507f5b 100644 --- a/teztale/bin_teztale_archiver/teztale_archiver_main.ml +++ b/teztale/bin_teztale_archiver/teztale_archiver_main.ml @@ -91,6 +91,7 @@ let server_to_json_chunk : Server_archiver.chunk -> Json_archiver.chunk option = | Mempool (level, ops) -> Some (Mempool (None, level, ops)) | Rights (_, _) -> None | Dal_shards (_, _) -> None + | Dal_attested_slots (_, _) -> None let select_commands _ctxt Client_config.{chain; _} = return @@ -234,6 +235,8 @@ let select_commands _ctxt Client_config.{chain; _} = | Mempool (level, _) -> (level, "/mempool") | Rights (level, _) -> (level, "/rights") | Dal_shards (level, _) -> (level, "/dal_shards") + | Dal_attested_slots (level, _) -> + (level, "/dal_attested_slots") in Printf.sprintf "(%ld) Failed to send %s data and --backup-dir is \ diff --git a/teztale/bin_teztale_server/teztale_server_main.ml b/teztale/bin_teztale_server/teztale_server_main.ml index 96ef508410b35502c647c106d8f2c9d2fc8bd54f..2b8ac1c805667ca11a0b5573fe9d449e17ad2c24 100644 --- a/teztale/bin_teztale_server/teztale_server_main.ml +++ b/teztale/bin_teztale_server/teztale_server_main.ml @@ -595,13 +595,30 @@ let insert_operations_from_block (module Db : Caqti_lwt.CONNECTION) conf level (block_hash, level) )) operations in - maybe_with_metrics conf "insert_included_operations" @@ fun () -> + let* () = + maybe_with_metrics conf "insert_included_operations" @@ fun () -> + without_cache + Sql_requests.Mutex.operations_inclusion + Sql_requests.insert_included_operation + (module Db) + conf + operation_inclusion + in + let dal_slots = + List.concat_map + (fun {Lib_teztale_base.Consensus_ops.op; dal_attested_slots; _} -> + List.map + (fun slot_index -> (level, op.hash, slot_index)) + dal_attested_slots) + operations + in + maybe_with_metrics conf "insert_dal_attested_slots" @@ fun () -> without_cache - Sql_requests.Mutex.operations_inclusion - Sql_requests.insert_included_operation + Sql_requests.Mutex.dal_attested_slots + Sql_requests.insert_dal_attested_slot (module Db) conf - operation_inclusion + dal_slots module Block_lru_cache = Aches.Vache.Set (Aches.Vache.LRU_Precise) (Aches.Vache.Strong) diff --git a/teztale/lib_teztale_base/consensus_ops.ml b/teztale/lib_teztale_base/consensus_ops.ml index 5f259e4e394ea091d022ecb39d989ab781a9b0ba..0ea985c05d0351a571a379c5b436ffc09b49c267 100644 --- a/teztale/lib_teztale_base/consensus_ops.ml +++ b/teztale/lib_teztale_base/consensus_ops.ml @@ -73,14 +73,18 @@ type block_op = { op : operation; delegate : Tezos_crypto.Signature.public_key_hash; power : int; + dal_attested_slots : int list; } let block_op_encoding = let open Data_encoding in conv - (fun {op; delegate; power} -> (op, delegate, power)) - (fun (op, delegate, power) -> {op; delegate; power}) - (obj3 + (fun {op; delegate; power; dal_attested_slots} -> + (op, delegate, power, dal_attested_slots)) + (fun (op, delegate, power, dal_attested_slots) -> + {op; delegate; power; dal_attested_slots}) + (obj4 (req "operation" operation_encoding) (req "delegate" Tezos_crypto.Signature.Public_key_hash.encoding) - (req "endorsing_power" int16)) + (req "endorsing_power" int16) + (dft "dal_attested_slots" (list int31) [])) diff --git a/teztale/lib_teztale_base/consensus_ops.mli b/teztale/lib_teztale_base/consensus_ops.mli index 32ef2a3445d736cda2006554e48f72d3af714664..6292c030949458c61d0ec60a3467005341375385 100644 --- a/teztale/lib_teztale_base/consensus_ops.mli +++ b/teztale/lib_teztale_base/consensus_ops.mli @@ -41,6 +41,7 @@ type block_op = { op : operation; delegate : Tezos_crypto.Signature.public_key_hash; power : int; + dal_attested_slots : int list; } val block_op_encoding : block_op Data_encoding.encoding